aspose file tools
The moose likes Object Relational Mapping and the fly likes one to many Mapping @ Hibernate. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "one to many Mapping @ Hibernate." Watch "one to many Mapping @ Hibernate." New topic
Author

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 table.do 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 : http://passion4java.blogspot.com
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: http://aspose.com/file-tools
 
subject: one to many Mapping @ Hibernate.
 
Similar Threads
ORM as compared to JDBC
Address-has-one-Customer with multiplicity many using foreign-key mapping
Can Foreign key be Null for some rows?
hiberante - one-to -many
Cascading non foreign key to Child Table