Deleted object would be re-saved by cascade

TDV's Avatar

TDV

10 Feb, 2011 04:30 AM via web

The question is why we get yhis message? Why NH cant remove item from collection or set property to null in this way?
For example: Objects of type B and C can contain same objects of type A in it list of childs mapped with HasMany().Cascade().All().

class A
{}
class B
{
IList<A> childs { get; set; }
}
class C
{
IList<A> childs { get; set; }
}

Deletion of object B: You will get an error ("...re-saved...") if someone object of type C contain same objects of type A. But if you evict this object C from session cache everything goes fine. I think where is only one reason to generate an error it is then notnull reference present.

    Reply to this discussion

    Preview Comments are parsed with Markdown. Help with syntax

    Attached Files

      You can attach files up to 10MB

      How many minutes are in an hour?