NHibernate: 1.2.0
Example project:
http://www.devatwork.nl/files/orphantest.rar
In my application I have 3 classes: Foo, Bar and Link. The Foo and Bar classes both contain an ID and a collection of Links. The Link class represents a link between the Foo and Bar classes.
The links are mapped with the cascade option ‘all-delete-orphan’.
Now image I create an exact replica of an existing Foo (including all the associated links) object and call the Session.Update() on it. Everything works as expected. When I change a property of a link it get updated as well. However when I don’t add an existing link to the Foo object the fooid of the DB entry of that particular is set to null instead of the whole row being deleted.
How come that the deleted links are not properly removed from the database? Am I missing something?