How to avoid an update which sets a null id when I delete a child from a collection?

12 views
Skip to first unread message

Michael Delva

unread,
Jan 25, 2012, 3:47:26 PM1/25/12
to nhu...@googlegroups.com
Hello everybody,

I have a Parent entity, which has some children in a collection mapped as a List (I need them to be ordered). 

I didn't set the Inverse attribute, because it interferes with the good behavior of the index property of the children table.

I have set Cascade as All && DeleteOrphan on the mapping of the collection.

When I remove a child from the collection, and update the parent, before NH effectively deletes the row, there is an Update query, which sets the ParentId of the child to NULL.

Is it possible to suppress this query? 

I guess this is the purpose of the Inverse attribute, and I can't avoid that. But I'm curious to know if I can avoid that query.

Thanks!
Reply all
Reply to author
Forward
0 new messages