Hi,
I have a parent table, Orders and a child table, [Order Details], I have setup the fluent mappings as -
(In the parent Order class)
HasMany<OrderDetails>
(x => x.Details).KeyColumn("OrderId").Cascade.AllDeleteOrphan().Inverse();
(In the child [Order Details] class)
References(x => x.ParentOrder).Column("OrderId").Not.Nullable().Cascade.None();
I am trying to delete the parent object by calling -
session.Delete(parent);
session.Flush();
this works only when there is only one child record, if there are more than one child records, the children get deleted, but the parent doesn't!!! And I get the dreaded - Unexpected row count error.
I am sure that this is something silly that I am doing, but trawling through the web hasn't turned up anything.
Thanks