Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bi-directional mapping in Hibernate

 
Swerrgy Smith
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have read many documents to try to understand the nature of bi-directional mapping but I still do not get it.
All I understand is that it allows some kinds of "navigation" from one object to another object in 2 directions.

Can anyone explain this for me with a concrete example? Thank you very much.

Best.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the below code, we have a bi-directional mapping. The Parent entity has a reference to the Child entity. The Child entity has a reference to two Parent entities. Depending on the Hibernate settings, all this data may be loaded at once or it might be loaded later (lazy loading.) If this doesn't help, can you ask more specifically what you are wondering about?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic