-->
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.  [ 2 posts ] 
Author Message
 Post subject: Deleting a <one-to-one ... cascade="all-delete-orpha
PostPosted: Fri Oct 14, 2005 5:14 am 
person and LoginInfo is one-to-one,
I want to delete Person's Loginfo, and it runs ok without any exceptions, but the record of Logininfo still in database.

Example:

//Person hbm.xml
Code:
<one-to-one name="TheLoginInfo" class="Entity.LoginInfo, Entity"  cascade="all-delete-orphan" outer-join="true" />


//Loginfo hbm.xml
Code:
<one-to-one name="ThePerson" class="Entity.Person, Entity" constrained="true"  outer-join="true"/>   



//Test code:
Code:
Person person = (Person)iParty.GetPartyByID("1");

person.TheLoginInfo.ThePerson = null;
person.TheLoginInfo = null;

session.update(person);


Top
  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 8:09 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
I don't know if "all-delete-orphan" applies to <one-to-one>...
You probably need to call:
Code:
session.Delete( person.TheLoginInfo );

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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

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.