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