-->
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.  [ 3 posts ] 
Author Message
 Post subject: inverse attribute ... enlighten me
PostPosted: Thu Feb 02, 2006 2:40 am 
Newbie

Joined: Thu Oct 20, 2005 11:52 am
Posts: 6
Hi,

I need some help to see the light with the inverse=true.... I understand how to get all different assocation relationships to work. But what keeps me awake is the exact role of the inverse property. Especially the following points:

-Role of Inverse on a Join with property elements (so join not for association). Does it make sense to ever do that?
-Role of Inverse on a joined one-to-one.
-Inverse on a one-to-many is it also true that: “Changes made only to the inverse end of the association are not persisted”. Or is that only true for many-to-many? (in 1-n tests it seems to persist also on the inversed side)

Is there a single clear definition of the inverse=true? There doesn't seem to be one in the docs....

Thanks!

Raphael


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 4:08 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
in a bi-directional relationship, one side must "own" the relationship - *both* cannot do this.

if class A owns the relationship w/ class B, object A is what the ORM looks to in order to manage that relationship in the data model.

by saying inverse="true", you are saying "I don't own the relationship, look at the other side (of the relationship) for what to do (w/ the SQL)".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 4:32 am 
Newbie

Joined: Thu Oct 20, 2005 11:52 am
Posts: 6
Dennis,

Thanks for your reply!

Does "owning" imply that changes made only to the inverse end of the association are not persisted (my 3rd point). Or does owning only specify where to find the information for this relation?

Is the inverse on a join element only used when that join element has a nested many-to-one and never when it merely has properties/component?


Tx.,

Raphael


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.