These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Orphans not deleted properly?
PostPosted: Sat Sep 08, 2007 2:57 pm 
Newbie

Joined: Tue Jul 03, 2007 3:21 am
Posts: 6
Location: Drachten, The Netherlands
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?

_________________
Weblog: Dev @ Work


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.