-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Meaning of inverse=true
PostPosted: Sat Feb 09, 2008 12:31 pm 
Beginner
Beginner

Joined: Thu Dec 13, 2007 2:32 pm
Posts: 26
Hi,

( This is with context to One to Many or Many to Many associations )

I have been reading that inverse=true is used to indicate to hibernate as to which side of the association it needs to manage, because foreign key column is duplicated.

I am unable to visualize this scenario,

can someone explain this to me, in terms of Product to Parts example ( Product to Parts is bi directional Many To Many association )

Regards
Vyas, Anirudh

_________________
Regards,
Vyas, Anirudh


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 4:58 pm 
Beginner
Beginner

Joined: Thu Dec 13, 2007 2:32 pm
Posts: 26
ANY ONE ?

_________________
Regards,
Vyas, Anirudh


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 1:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
OK - Many-to-many one side needs to be inverse true (assuming you are updating both sides of the Java instance object relationship). The reason is simple - think in terms of an event being generated that hibernate needs to save the relationship in the database. If both sides generate an update event then there could be a problem with the SQL operation due to two operations being signaled when it only requires to be executed once. The inverse states that this side does not require an event to be generated or alternatively the other sode will generate the event - so for example - making both sides inverse will result in no SQL operation being generated as no event will be signaled from either side.


Top
 Profile  
 
 Post subject: Re: Meaning of inverse=true
PostPosted: Fri Sep 30, 2011 5:57 am 
Newbie

Joined: Fri Sep 30, 2011 5:51 am
Posts: 1
Thanks a lot david. I am new to Hibernate and thus trying to find out meaning of inverse.
Short and fantastic explanation for THE inverse attribute.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.