-->
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=true on the many-to-one side of a relationship
PostPosted: Wed Jun 09, 2004 5:08 pm 
Beginner
Beginner

Joined: Sat Aug 30, 2003 1:36 am
Posts: 47
Location: Calgary, AB
Why can't you put the inverse="true" on the many-to-one side of a bidirectional association of a collection.

ex:
in class Y:
<many-to-one name="x" column="xKey" class="X" />

in class X:
<bag name="ys" cascade="all-delete-orphan" inverse="true" >
<key column="xKey"/>
<one-to-many class="Y"/>
</bag>

Why couldn't you put the inverse="true" in the many-to-one like so:
<many-to-one name="x" column="xKey" class="X" inverse="true" />

So that the saves would happen through the collection? Right now,the collection does not get persisted when saving X.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 7:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The cascade attribute provides the saving/update etc mode for the collection.
Read about the various option (try 'all') at
http://www.hibernate.org/hib_docs/reference/en/html/collections.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 7:36 pm 
Beginner
Beginner

Joined: Sat Aug 30, 2003 1:36 am
Posts: 47
Location: Calgary, AB
Shouldn't all-delete-orphan work?


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.