Questions tagged [relation]

A relation on sets S1, S2, ..., SN is any subset of S1 x S2 x ... x SN, where 'x' denotes the Cartesian product. In other words, a relation over N sets is any set of ordered N-tuples over the N sets.

A relation on sets S1, S2, ..., SN is any subset of S1 x S2 x ... x SN, where 'x' denotes the Cartesian product. In other words, a relation over N sets is any set of ordered N-tuples over the N sets.

1457 questions
7
votes
2 answers

Define a custom ordering criteria in the relations() method

I have a model A that has a relationship of type HAS_MANY with model B. B's attributes are: id, user_id, message, date, parent_message_id I need elements of model B to be ordered by date (descending), but in case the parent_message_id is different…
Soph
  • 2,895
  • 5
  • 37
  • 68
7
votes
1 answer

Loopback $owner doesn't works for findById

I would like to get some informations about my user with loopback. For that I created a "user" model related with "accessToken" model until now a POST on /user, a POST on /user/login and a POST on /user/logout is working. I added on…
Jonny
  • 71
  • 1
7
votes
2 answers

Yii Criteria: condition for relation

i have two tables: User and User_works (User HAS_MANY User_works). How can I add a condition to be displayed only users with certain works User contains fields: id | name | Other information User_works: id | user_id | work_id User Model: public…
Taram
  • 173
  • 1
  • 1
  • 6
7
votes
1 answer

What is the purpose of ActiveRecord::Relation#bind?

Just out of curiosity - I was reading the docs of the Relation::QueryMethods module and found that method: def bind(value) relation = clone relation.bind_values += [value] relation end Does anyone know what is this? I tried to find by…
m_x
  • 12,357
  • 7
  • 46
  • 60
6
votes
2 answers

using onDelete with Doctrine 2

I can't get the onDelete to work in Doctrine2 (with YAML Mapping). I tried this relation in my Product class: oneToOne: category: targetEntity: Category onDelete: CASCADE But that doesn't work.. EDIT: I've set the ON DELETE: CASCADE…
tamir
  • 3,207
  • 2
  • 33
  • 51
6
votes
1 answer

NLTK relation extraction returns nothing

I am recently working on using nltk to extract relation from text. so i build a sample text:" Tom is the cofounder of Microsoft." and using following program to test and return nothing. I cannot figure out why. I'm using NLTK version: 3.2.1, python…
hiber
  • 63
  • 1
  • 5
6
votes
2 answers

Yii 2: multiple relation with same table

I've got a problem with Yii 2 Relation Tables. My work has many relations, but only in this case return me an error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'father.name' in 'where clause' I think the problem is the double relation…
garsim
  • 160
  • 2
  • 11
6
votes
3 answers

Exception handling inside twig template

i am new to symfony2. my project has two entity [1] Category and [2] Evaluation and category has many evaluation, so the problem is when i delete the category and then display the evaluation then it display me error like "An exception has…
Dr Magneto
  • 981
  • 1
  • 8
  • 18
6
votes
3 answers

"Transposing" objects in jq

I'm unsure if "transpose" is the correct term here, but I'm looking to use jq to transpose a 2-dimensional object such as this: [ { "name": "A", "keys": ["k1", "k2", "k3"] }, { "name": "B", "keys": ["k2",…
cmbuckley
  • 40,217
  • 9
  • 77
  • 91
6
votes
1 answer

How to rewrite over Rle inside a term with Rmult in Coq?

With respect to the relation Rle (<=), I can rewrite inside Rplus (+) and Rminus (-), since both positions of both binary operators have fixed variance: Require Import Setoid Relation_Definitions Reals. Open Scope R. Add Parametric Relation : R…
Daniel
  • 71
  • 2
6
votes
2 answers

Coq: apply transitivity with substitution

I want to proof this lemma in Coq: a : Type b : Type f : a -> b g : a -> b h : a -> b ______________________________________(1/1) (forall x : a, f x = g x) -> (forall x : a, g x = h x) -> forall x : a, f x = h x I know that…
SvenK
  • 2,584
  • 2
  • 21
  • 24
6
votes
3 answers

How to have a many to many relation that enforces uniqueness when I use an intermediate model?

I use intermediate model for "ManyToManyField using the through" Normally,If I don't use intermediate field, the m2m relation will be unique and can't have the duplicated data. After I use intermediate model. the relation between m2m can have same…
Kendo Jaa
  • 95
  • 2
  • 9
5
votes
2 answers

setting the correct jpa mapping for shopping cart items and product

I am learning jpa through some examples ,involving a shopping cart and cart items.I defined them as below..but am not very sure about which mapping to use @Entity class Product{ private Long id; private String name; ... } @Entity class…
jonlannister
  • 75
  • 1
  • 5
5
votes
0 answers

How to apply condition to a relation, or how to properly handle JOIN queries with WHERE clause in Room?

Please bear with me, i'm new to architecture components and android in general. My question is similar to this question but unfortunately the accepted answer doesn't seem to work. I have an example one to many relation like in this answer. My…
nulldroid
  • 1,150
  • 8
  • 15
5
votes
1 answer

relation between random testing and fuzz testing

I am wondering what the relation between random and fuzz testing is. I understand that random testing has been there for a longer time, but I cannot see any differences between them. They both seem to make use of random input to see if the program…
1 2
3
96 97