-->
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.  [ 1 post ] 
Author Message
 Post subject: Unidirectional relationship after deleting a child object
PostPosted: Thu Feb 22, 2007 2:26 pm 
Newbie

Joined: Mon Jun 26, 2006 4:52 am
Posts: 8
Hello,

I'm facing what looks like a a common problem, but can't find the solution (or is it right before my eyes?)
I have many "many-to-many" unidirectional relationship in my application defined as this:
Code:
<set name="sandboxServices" table="USER_SERVICE">
<key column="USER_ID"/>
<many-to-many class="com.amadeus.wsadmin.objects.Service" column="SERVICE_ID"/>
</set>


When I delete a '"child" object, none of the collections containing this child is updated, leaving me with corrupted association tables...

I was expecting Hibernate to be able to take care of this, as "he" is supposed to have knowledge of all collections refering to a particular type of object.

Instead I have, to iterate through all my parent objects, and remove manually the removed object from the sets.

Am i missing something ? Is there a way to force Hibernate to look for the associations and clean them ?

Many thanks for your help.
- ju


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

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.