persiste the deletion operation from a collection in NHibernate
When i delete some object (or remove it) from a collection (such as list) and call SaveOrUpdate from the parent of this collection the row of the child isn't removed but updated by setting the foreign key value to NU开发者_如何转开发LL.
How can i force it to be deleted (the child row).
You need to mark the collection as the inverse side of the relationship and set the cascade setting to all-delete-orphan. NHibernate is attempting to update the foreign key to null because you have created an orphan by removing it from the collection but haven't instructed it to delete orphans.
精彩评论