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
4
votes
3 answers

Inverse Relationship with Core Data Causes Crash when Adding Object to NSSet

I have 2 entities in Core Data, a Bill and Person. I have two relationships: Bill to Person is a 'To Many' relationship called 'people' The inverse - from Person to Bill is 'To One'- called 'bill'. The result generated by Xcode (along with the…
Daven
  • 549
  • 4
  • 11
4
votes
2 answers

Neo4j: error in adding relationships among existing nodes

When writing a query to add relationships to existing nodes, it keeps me warning with this message: "This query builds a cartesian product between disconnected patterns. If a part of a query contains multiple disconnected patterns, this will build a…
sirdan
  • 1,018
  • 2
  • 13
  • 34
4
votes
2 answers

How would I code this MySQL query in Laravel Eloquent?

I'm trying to work with a semi-complex query (by my standards, anyway) but I can't think how to do it using the query builder or using eloquent relationships. My relationships table is: user_id_1 | user_id_2 | status | action_user_id in the case of…
Jean-Luc Tallis
  • 315
  • 1
  • 4
  • 11
4
votes
1 answer

Check if friends in laravel

How to check, if Auth:user() is friend of current $user? This will be placed on the profiles, in order to show add friend buttons or pending requests, etc? I've tryed, relationships with other methods and where clauses, but still no success. Please…
JCC
  • 43
  • 1
  • 9
4
votes
0 answers

How to get acts_as_list to work with a has_many through association?

I am having trouble figuring how to add drag and drop to a has_many through association? I have a Model for Boards and each Board has many Lists. Each List has many Cards and each Card has many Lists through a join model called ListCard I am trying…
4
votes
1 answer

Optional relationship in SQL Server -- How to implement in SSMS Schema Designer

I have two cases where I would like to set 'optional' relationship inside one table or between two tables. First: I want to set this relation as optional, in other words: there will be categories and subcategories in one table, so subcategory…
4
votes
1 answer

Database Model to Represent Families, Households, and Relationships

Here's my situation. I am building a database to track relationships between people and households. Typically, everything is tied to a "head of household". I am trying to avoid this as it creates problems when people move (i.e. brother finally gets…
imfm
  • 119
  • 7
4
votes
2 answers

Conditional Relationship in Graph DB

How would a graph model handle a conditional relationship like: (Alice -[Dates]-> Bob) Where [Dates] exists IF and ONLY IF (Bob -[Owns]-> Ferrari) is true Besides just querying, I'm wondering whether the relationship be applied by the database…
Jonathon Anderson
  • 1,162
  • 1
  • 8
  • 24
4
votes
3 answers

Can association lines be merged in one line in UML?

Is it in accordance with the UML standard to merge a few association lines into one line, like on the attached diagram?
Adam Siemion
  • 15,569
  • 7
  • 58
  • 92
4
votes
1 answer

Neo4J - Storing into relationship vs nodes

I was wondering if there are any advantages or disadvantages in storing data into relationships or nodes. For example, if I were to store comments related to a discussion into the DB, should I store the comment data in a "comment" relationship or a…
RazorHead
  • 1,460
  • 3
  • 14
  • 20
4
votes
2 answers

Laravel - Pivot table for three models - how to insert related models?

I have three models with Many to Many relationships: User, Activity, Product. The tables look like id, name. And in the each model there are functions, for example, in User model: public function activities() { return…
volion80
  • 113
  • 1
  • 6
4
votes
4 answers

Does association in UML associate objects or classes?

On Wikipedia, I'm reading that an association relationship is an instance level relationship so we are talking about the relationship between the objects of two classes. When we actually draw a class diagram, why do we use association on the class…
cpx
  • 17,009
  • 20
  • 87
  • 142
4
votes
3 answers

reading the association relationship

I read the illustrated relationship as:Class A associated with class B So,what is the meaning of : 1) +class B at the end of association 2)0..1 Now,how can I read the relationship?
user2019510
  • 1,460
  • 5
  • 16
  • 29
4
votes
2 answers

JSON to Core Data with Relationships

Following Ray Wenderlich's new tutorial I was able to get JSON data and store it into Core data. I am having a really hard time understanding how to do this with relationships in Core Data though. Here is my Data Model: Here is my JSON: { …
mkral
  • 4,065
  • 4
  • 28
  • 53
3
votes
0 answers

Relationships and References in Mongo DB

I am currently working on a project in which there are many threads that users can create. User's have different permissions for the threads that can be specified by users with admin permission. User's need to be added to the thread before they have…
Dr.Numbers
  • 31
  • 1