-->
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: Is this the expected behaviour for cascade="all-delete-
PostPosted: Thu Sep 23, 2004 4:33 pm 
Beginner
Beginner

Joined: Thu Jan 22, 2004 8:22 pm
Posts: 48
If I have a parent object A which has a list of children which contains child B. When I remove B from the child list of A and then add it to the list of children for parent object C I get the exception from Hibernate shown below. Is this the expected behaviour?

net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 1097630, of class: dor.utility.form.basic.FormField

The code I use to move the child from one parent to the next is :

parent1.removeChild(child);
parent2.addChild(child);

It's not a enormous issue as this works with cascade="all". It's just that I have to watch out for orphans myself and after reading the parent/child section in the manual and a number of threads here in the forums it wasn't immediately apparent to me that this would not work.


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.