Hi,

I have a parent-child relationship with a one-to-many and a set on the
parent.

I am trying to move a child from one parent to another and am using
the following code:

parentA.Children.Remove(child);
parentB.Children.Add(child);
child.Parent = parentB;

In the hbm mapping file for the parent I have a set with cascade="all-
delete-orphan". When I execute the above code and commit the
transaction, I get an exception "deleted object would be re-saved by
cascade (remove deleted object from associations)".

What is the correct way to move a child across to a different parent?

Thanks,

Jason
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to