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.
|
|