Questions tagged [one-to-many]

one-to-many is relationship between two different object properties.

One object property is relating with many properties of other object. Or you can say one object relating to many objects.

In sql, a one-to-many relationship, each row in the related to table can be related to many rows in the relating table.

http://en.wikipedia.org/wiki/One-to-many

3715 questions
1
vote
2 answers

Looking for an elegant way to store one-to-many relationship in coredata when order is important

I've been trying to come up with a way to solve my problem, but every solution I can think of is messy and makes me want to retch. I have a one-to-many relationship, consisting of a Team object that can have many Member objects. When I built my…
Eric Schweichler
  • 1,092
  • 6
  • 11
1
vote
1 answer

Efficient one-to-many SQL Query

I'm working on writing an application that uses a database to store applications and the systems on which they rely. I am using a Microsoft Access database to store my information. My application is written in VS 2013 in C# using OleDbCommand and…
JustWannaFly
  • 301
  • 1
  • 11
1
vote
1 answer

What are some SQL queries for "one-to-many" meta data filtering?

I've been away from writing SQL for a while now, I am trying to find an easier solution to the following, the below works, but is there an easier, more optimized solution? SELECT `application`.*, GROUP_CONCAT( DISTINCT `application_tags`.`tag` ) AS…
farinspace
  • 8,422
  • 6
  • 33
  • 46
1
vote
1 answer

Accessing specific users for use with database relations

I am working on a Django project that has multiple users that need to be able to interact with each other, such as sending messages or charging one another. However I am unsure how exactly I am supported to do this. I have a few models like this…
user3282276
  • 3,674
  • 8
  • 32
  • 48
1
vote
0 answers

Testing Pubnub + WebRTC Scalability

Finally got a working set up that I am happy with for now using Pubnub + WebRTC. I want to now test how well this would all scale but really do not know where to start, test broadcasting one to many. I want to be able to test 100 different…
JerryFox
  • 615
  • 2
  • 13
  • 25
1
vote
0 answers

Hibernate join table lazy loading

I use hibernate 4.1.6.Final. And in my case lazy loading of @OneToOne association with @JoinTable didn't work. TABLES: CREATE TABLE PERSON ( "ID" NUMBER NOT NULL ENABLE, "NAME" VARCHAR2(200 BYTE) NOT NULL, CONSTRAINT "PERSON_PK" PRIMARY…
1
vote
0 answers

Restkit: How to configure mappings to POST a nested array of NSManagedObjects

Please skip this part to UPDATE 3. Environment: iOS7.1, MagicalRecord, Restkit, Mogenerator The required JSON form looks like this: {"amount":[10,20,50]} (set of TSNDecimal's in TSNTagAmountRequest) The following entities are involved in the…
Vladimír Slavík
  • 1,727
  • 1
  • 21
  • 31
1
vote
1 answer

RestKit: Inverse Relationship Empty After Initial Mapping

Trying to connect two entities from my API from a single response. { "id": 4546, "body": "Direct message", "status": "received", "from": { "id": 723, "signature": "Mr. Whatever" }, "sent_at":…
LeffelMania
  • 12,765
  • 4
  • 32
  • 34
1
vote
1 answer

How can I persist a HashMap with JPA

Hello I'm a newbie with the JPA-Framework. In my project I use JPA with EclipseLink and DerbyDB. It's all working for me fine. But then I would persist a HashMap, that's my problem. The HashMap looks like (used in GameArea): private…
1
vote
1 answer

How to Insert one to many relationship using checkboxlist in VB.NET, LINQ to SQL?

I have 3 tables: CustomerType CusID EventType EventTypeID CustomerEventType CusID EventTypeID How to Insert one to many relationship using checkboxlist in VB.NET, LINQ to SQL? dim newEventType = new EventType newEventType.EventID =…
Vicheanak
  • 6,444
  • 17
  • 64
  • 98
1
vote
0 answers

OneToMany relation doesn't get the ID

I have two entities (Item and Products). One item has only one product. One product could have 0 or N items. When I Create a new Item, all is right except product_id is null, but in dev environment product_id is right. class Item{ /** * @var…
user3396420
  • 810
  • 2
  • 13
  • 34
1
vote
1 answer

Hibernate: which table is owner table in one-to-many unidirectional relationship using join table

How do we decide which table is the owner table in a unidirectional one-to-many relationship using join table? What role does it play? Hibernate documentation talks about owner table name and other side table name. I am using Hibernate with JPA…
skip
  • 12,193
  • 32
  • 113
  • 153
1
vote
4 answers

How to properly index a table two other tables have a one-to-many relationship to?

Imagine I have three tables, called "customers", "companies" and "phone_numbers". Both customers and companies can have multiple phone numbers. What would be the best way to index phone_numbers? Have both customer_id and company_id and keep one of…
zaratustra
  • 8,148
  • 8
  • 36
  • 42
1
vote
2 answers

How to change one-to-one relationship to one-to-many relationship in MySQL?

I currently have a user's table which contains a one-to-one relationship for Youtube OAuth tokens. However, I now want to support multiple video sites and want to break this into a one-to-many relationship. I have setup the new tables: tokens -…
Matt McCormick
  • 13,041
  • 22
  • 75
  • 83
1
vote
1 answer

Laravel 4 relationship sort one-to-many count eager loading

No sure if this is possible. I can sort everything inside the current table artists(title, body etc) but haven't figured out sorting it to tables related to it. I want to sort the artist based on how total number of songs he/she has DESC, ASC. How…
Vartox
  • 189
  • 3
  • 12
1 2 3
99
100