This document outlines the different Hibernate association mappings including @OneToOne, @OneToMany, @ManyToOne, and @ManyToMany. It specifies that for uni-directional mappings the parent class needs a reference to the child, while for bi-directional both the parent and child need references to each other. For collections, the parent needs a collection property of the child type and the child needs a reference to the parent.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
36 views
Assosiation in Hibernate
This document outlines the different Hibernate association mappings including @OneToOne, @OneToMany, @ManyToOne, and @ManyToMany. It specifies that for uni-directional mappings the parent class needs a reference to the child, while for bi-directional both the parent and child need references to each other. For collections, the parent needs a collection property of the child type and the child needs a reference to the parent.
way Uni directional Parent/Child class Parent class Child class should Parent class should have should have Child have Parent class should have Child Child/Parent class class collection reference type class collection reference type type property property type property property AND Child class should have Parent class collection type property Bi directional Parent class Parent class Parent class should have Child should have Child should have Child class reference class collection class collection type property type property type property AND AND AND Child class should Child class should Child class should have Parent class have Parent class have Parent class reference type reference type reference type property property property