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

Combining multiple rows into one row, Oracle

I'm working with a database which is created in Oracle and used in a GIS-software through SDE. One of my colleuges is going to make some statistics out of this database and I'm not capable of finding a reasonable SQL-query for getting the data. I…
Torbjørn
  • 11
  • 1
  • 2
1
vote
0 answers

How to replace all ordered to-many relationships in NSManagedObject ios

First, please note, I'm aware of the NSOrderedSet bug. I think the issue I have is that I don't fully understand removeXXX:(NSOrderedSet*)values. I want to replace and old ordered set with a new ordered set of objects. What I would have thought…
Matt
  • 4,261
  • 4
  • 39
  • 60
1
vote
1 answer

DbUnit and recursive entity

I have a Hibernate entity that has recursive relationship to itself (parent-children). And I use DbUnit XML file to insert some data in my tests, including a relationship. However, on my service under test that queries for the list of parent=null…
redhead
  • 1,264
  • 1
  • 17
  • 32
1
vote
2 answers

unique constraint (w/o Trigger) on "one-to-many" relation

To illustrate the problem, I make an example: A tag_bundle consists of one or more than one tags. A unique tag combination can map to a unique tag_bundle, vice versa. tag_bundle tag tag_bundle_relation …
rnd_nr_gen
  • 2,203
  • 3
  • 36
  • 55
1
vote
1 answer

Linq-to-sql Add item and a one-to-many record at once

I have a function where I can add articles and users can comment on them. This is done with a one to many relationship like= "commentId=>ArticleId". However when I try to add the comment to the database at the same time as I add the one to many…
Oskar Kjellin
  • 21,280
  • 10
  • 54
  • 93
1
vote
1 answer

NHibernate - How to properly handle One-to-Many references in code

What it the proper way to handle One-to-Many on the code side with NHibernate, keeping in mind that our collection could be huge (lets say 400 000 references) Currently in my application, I handle them with ISet this way: public class Questionnaire:…
Samuel Poirier
  • 1,240
  • 2
  • 15
  • 30
1
vote
2 answers

List of Hashmap in one to many relationships

I have 2 tables with relationship of one-to-many. What I need to do is to categorize the sub-table (many part) into some categories and display them. So for example, I have a region and product table. so one region will have many products, but there…
pms
  • 944
  • 12
  • 28
1
vote
1 answer

UniqueEntity validation for OneToMany related entities

I have the following validations defined for ProductType, ProductTypeAttributes (OneToMany): Bike\ProductBundle\Entity\ProductType: properties: name: - NotBlank: ~ productTypeAttributes: - Valid:…
gus
  • 15
  • 3
1
vote
1 answer

ORMLITE one-to-many recursive relationship

Hello i am facing a problem: I need to store a tree representation of subjects. I mean a SUBJECT have a list of childrens of type SUBJECT @DatabaseTable(tableName = "subject") public class Subject implements Serializable…
Darien Alvarez
  • 153
  • 2
  • 10
1
vote
1 answer

How to store a List in a Django model

How can I store a list of Livre for each User in my Django model.py? Which looks like: class Livre(models.Model): auteur = models.ForeignKey(Auteur) titre = models.CharField(max_length=50) genre = models.ForeignKey(Genre) …
0xmax
  • 503
  • 1
  • 6
  • 26
1
vote
0 answers

Eclipselink - Onetomany - Poor performance

I am going to try to explain clearly my problem. Context: I am doing a web app with : glassfish v3, EclipseLink. My problem is about the low performances of a bidirectionnal oneToMany relationship. I have one class Event and one class photo. One…
ArthurG
  • 21
  • 2
1
vote
1 answer

Unsaved Transient Instance Hibernate

Although there are several questions related to this exception, Folks, this is not a possible duplicate . Iterating through multiple excel sheets using APACHE POI , I have to use JPA to perform a many to one relation for (int i = 0; i <…
Abhinav
  • 71
  • 1
  • 1
  • 11
1
vote
1 answer

sqlalchemy relation through another (declarative)

Is anyone familiar with ActiveRecord's "has_many :through" relations for models? I'm not really a Rails guy, but that's basically what I'm trying to do. As a contrived example consider Projects, Programmers, and Assignments: from sqlalchemy import…
clayg
  • 347
  • 1
  • 3
  • 9
1
vote
0 answers

Table relation to itself in Rails 4

Please check the attached image as you can see there is a one to many relation between PrizePartner and AvailablePartner And here is the logic: One prize partner can select another partner to be his prize partner (on his behalf) So available…
Mr H
  • 5,254
  • 3
  • 38
  • 43
1
vote
1 answer

Google App Engine (NDB): One-To-One and One-To-Many relationship

I am building a web application (Django and google's NDB) and have to structure my models now. I have read many examples about how to implement One-To-Many but - to be honest - I'm even more confused right now after having read these. Let me…