Questions tagged [relationships]

Relationships refer to mappings between elements of one set to another set, such as one-to-one, one-to-many, many-to-many.

Relationships can be implicit or explicit depending upon the data model.

Types of relationships

References

832 questions
12
votes
1 answer

Neo4J relationships with time constraints

I have relationships between nodes which are only valid for a specific time. Simple example: Person P lived at Address A from time t1 to time t2. I can put a validFrom and a validUntil property on the relationship, but when using cypher, I have to…
ignazw
  • 129
  • 1
  • 6
11
votes
1 answer

Creating BiDirectional One - One relationship in Entity Framework 4.1 Code First

I want to created Bi-Directional One-One relationship between two entities using EF Code First. I have trouble with the following code. What do you think I should do? public class User { public string ID { get; set; } public string LastName…
Preetham Reddy
  • 611
  • 2
  • 8
  • 19
11
votes
2 answers

How to set a 0..* relationship in Entity Framework Code First?

I have the next code for two classes: public class Object { public int ObjectID { get; set; } public int Object2ID { get; set; } public virtual Object2 Object2 { get; set; } } public class Object2 { public int Object2ID { get; set;…
Jorge Díaz
  • 137
  • 1
  • 1
  • 10
11
votes
1 answer

Laravel: Querying and accessing child objects in nested relationship with where clauses

I am trying to access the child objects of nested relationships that return many results from the parents object. Let's say I have 4 models : Country - Provinces - Cities - Municipalities Their relationships are as follows : Country Model class…
sholmes
  • 113
  • 1
  • 1
  • 5
11
votes
4 answers

Rails accepts_nested_attributes_for child doesn't have parent set when validating

I'm trying to access my parent model in my child model when validating. I found something about an inverse property on the has_one, but my Rails 2.3.5 doesn't recognize it, so it must have never made it into the release. I'm not sure if it's…
brad
  • 31,987
  • 28
  • 102
  • 155
11
votes
2 answers

Core Data Deletion rules and many-to-many relationships

Say you have departments and employees and each department has several employees, but each employee can also be part of several departments. So there is a many-to-many relationship between employees and departments. When deleting a department I…
10
votes
1 answer

How can I join with Eloquent: Relationships?

My query is like this : user()->id) ->get(); return $reviews; } From the query, it can get all review data by id I want get user…
moses toh
  • 12,344
  • 71
  • 243
  • 443
8
votes
1 answer

RestKit Object Mapping Relationships without KVC

After reading the Object Mapping-Guide on GitHub for RestKit my problem didn't disappear, so perhaps somebody can say if RestKit could deal with the following idea. Entities with Relationships Company - unitID - companyID - name - contacts*…
flashfabrixx
  • 1,183
  • 9
  • 22
8
votes
1 answer

Laravel follower/following relationships

I am trying to make a simple follower/following system in laravel, nothing special, just click a button to follow or unfollow, and display the followers or the people following you. My trouble is I can't figure out how to make the relationships…
MDeian
  • 83
  • 1
  • 6
8
votes
1 answer

Neo4j creating relationships using csv

I am trying to create relationships between 2 types of nodes using csv file loaded. I have already created all Movies and Keywords nodes. I created also indexes on :Movie(title) and :Keyword(word). My csv file looks like: "title"|year|"word"…
Gondil
  • 787
  • 3
  • 9
  • 28
8
votes
4 answers

How to rollback relationship changes in EmberData

I have two models with parent-child relationship: training and exercise: App.Training = DS.Model.extend({ exercises: DS.hasMany('App.Exercise') }) App.Exercise = DS.Model.extend({ training: DS.belongsTo('App.Training') }) I want to have a page…
tothda
  • 136
  • 2
  • 6
7
votes
2 answers

Using CGridView for a model's association

I have a model with has_many association. Let's just say Student has many Courses. I'd like to show all courses of a particular student using CGridView. Something like this: $this->widget('zii.widgets.grid.CGridView', array( …
Heinrich Lee Yu
  • 1,472
  • 15
  • 31
7
votes
1 answer

Laravel Eloquent and Trimming fields for use in relationships

So I've got a couple of models which I'm setting up for use with Laravels Eloquent ORM... The tables these models refer to are populated by a third party program, which I do not have much ability to edit, so the following annoyance I have to find a…
Kieran
  • 752
  • 1
  • 10
  • 24
7
votes
2 answers

Laravel whereHas on Many-to-Many relationships

I have two main tables with relationships many to many and a pivot table. Model 'Type' public function attributes() { return $this->belongsToMany('App\Attribute', 'attribute_type'); } Model 'Attribute' public function…
Estern
  • 129
  • 1
  • 2
  • 10
7
votes
2 answers

Entity Framework, Bulk Inserts, and Maintaining Relationships

I have what would seem to be a common problem yet I cannot figure out how to achieve the desired outcome. I have a nested entity with navigation properties defined on it as seen in the following diagram. The map points collection can potentially…
jamesamuir
  • 1,397
  • 3
  • 19
  • 41
1
2
3
55 56