Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one to many Mapping @ Hibernate.

 
Mohammed Yousuff
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mohammed Yousuff
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that true that we can't map one-to-many is they don't have primary and foreign key relationship???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic