Top "One-to-many" questions

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

EF Core 2.1: Self-referencing entity with one to many relationship generates additional column

I have the following entity: public class Level { public int LevelId { get; set; } public int? ParentLevelId { get; set; } public string …

c# entity-framework-core one-to-many ef-fluent-api ef-core-2.1
Inserting One to Many Entities using dapper

I have following two classes and corresponding db tables. I am trying to insert the full object graph (student with …

.net sql insert one-to-many dapper
JPA: How do I add new Items to a List with a OneToMany annotation

I have 2 tables. One is called Employee, and the other is called Phones, and an employee can have multiple Phones. …

java jpa one-to-many cascading
Enable cascading deletes in EF Code First without exposing foreign key

When performing a delete of a one-many relationship without exposing the foreign key, EF deletes the parent record and tries …

entity-framework one-to-many code-first cascading-deletes
Hibernate one to many mapping error - mappedBy reference an unknown target entity property error

I am trying to test one to many mapping by creating tables from domain objects but I see the error …

database hibernate mapping one-to-many schemaexport
java.lang.IllegalArgumentException: Can not set java.lang.Short field to java.lang.Short

I am new to hibernate, I am having the following classes, I am using Spring hibernate and mysql. import javax.…

spring hibernate one-to-many spring-orm
How to implement a Counter Cache in Rails?

I have a posts controller and a comments controller. Post has many comments, and comments belong to Post. The associate …

ruby-on-rails one-to-many counter-cache
Linq to entities - how to select entities with a where condition on their entitycollection?

I found several times people asking for the same question but it seems that the answer was never satisfying altough …

entity-framework linq-to-entities one-to-many eager-loading entitycollection
JPA Composite key with ManyToOne getting org.hibernate.PropertyAccessException: could not set a field value by reflection setter of

I have a composite key ContractServiceLocationPK made out of three id's (contractId, locationId, serviceId) of type long in an embeddable …

java hibernate jpa one-to-many many-to-one
How to implement one-to-many relationships in Ibatis?

Let's say I have this Class: Class A { int id; int[] b; // Other properties } Class B { int id; // Other properties } …

java ibatis one-to-many