This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes one to many Mapping @ Hibernate. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "one to many Mapping @ Hibernate." Watch "one to many Mapping @ Hibernate." New topic

one to many Mapping @ Hibernate.

Mohammed Yousuff
Ranch Hand

Joined: Oct 17, 2007
Posts: 198
In my application we are using one to many mapping.Where we have 3 table .

Master Table
Parent Table
Child Table

Parent table is a one-to-one mapping with Master Table. Now we are mapping the Master Table Id(which is in Parent table as Foreign key) and mapping with the child table with one to many relation ship. In this scenario we are not able to load child element only the parent objects get loaded.

My peer developer is saying that you can't use the one-to-many mapping until you don't have foreign relation ship with you child table.I am not sure whether that is correct ???.

In this problem you don't have direct foreign key relationship with parent and child you guys have any thoughts on this.

Thanks in advance and please let me know if you have any clarification in this problem. thanks again

My Thoughts :
Try not to become a man of success but rather to become a man of value.
Mohammed Yousuff
Ranch Hand

Joined: Oct 17, 2007
Posts: 198
Is that true that we can't map one-to-many is they don't have primary and foreign key relationship???
I agree. Here's the link:
subject: one to many Mapping @ Hibernate.
It's not a secret anymore!