-->
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: Problem updating a child
PostPosted: Fri Nov 18, 2005 3:01 pm 
I am fairly new to NHibernate and have been reading up as quickly as I can. Unfortunately I have run into a problem that I can't figure out and need to resolve ASAP. I'm sure that there is something small that I'm overlooking but I'm just not seeing it. Any assistance would be greatly appreciated.

I have a one-to-many parent/child relationship. What I want to do is reassign the child to a different parent. However, when I remove the child from the original parent and then add it to the new parent I get the following error:

NHibernate.ObjectDeletedException : deleted object would be re-saved by cascade (remove deleted object from associations)

Inverse is set to true.
Cascade is set to "all-delete-orphan".

The child's parent collection setter looks like this:

if (this.parent != null)
this.parent.RemoveChild(this);

if(value != null)
value.AddChild(this);

this.parent = value;


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