-->
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.  [ 3 posts ] 
Author Message
 Post subject: set and cascade all
PostPosted: Sun Sep 19, 2004 9:15 am 
Newbie

Joined: Sun Sep 19, 2004 9:03 am
Posts: 6
Hibernate version: 2.1

Hi,

I have a set of licences in a class person :

public class Person {
...
/**
* @hibernate.set lazy="false" cascade="all" order-by="type"
* @hibernate.collection-key column="idPerson"
* @hibernate.collection-one-to-many class="com.foo.License"
* @return Returns the licenses.
*/
public Set getLicenses() {
return licenses;
}
...
}

I have cascade at "all". When I load a person with X licences, if I remove all the license and I call save on it, the license are not deleted, only idPerson is set at null in table License...why ?

The behavior I want is the deletion of the license in database.

Regards,
Syl


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 19, 2004 9:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
use cascade="all-delete-orphan"


P.S. From your slew of questions, I recommend you spend more time with the documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 19, 2004 9:31 am 
Newbie

Joined: Sun Sep 19, 2004 9:03 am
Posts: 6
Thanx a lot ... you save my sunday ... and sorry for spamming ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.