Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inverse in Bidirectional Mapping

 
vivek dhiman
Ranch Hand
Posts: 152
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was just going through 1-M bidirectional mapping's inverse keyword in hibernate. I searched lot but not able to find example where there should be mandatory to have an inverse true. Just observed the difference in number of update queries fired. Can any one provide some example where it is necessary to make inverse=true.

Thanks
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you don't need to use inverse if you are using mappedBy. The only difference is mappeBy explicitly points to the owning side where as inverse=true does not. Inverse does not require knowledge of an owning side in fact their might not even be one. I guess the point I am making is every time you add a mappedBy you are in essence setting inverse-true
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic