Hibernate Books

All times are UTC - 5 hours [ DST ]

Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: mystery of many to many
PostPosted: Fri Jun 27, 2008 11:35 am 

Joined: Tue Jun 24, 2008 6:42 am
Posts: 19
Hello everybody

I have a Child with two parents, and if I delete a single parent and the Child is also deleted, yet it remains a parent, so it is not an orphan! it should not be deleted!

my mapping:

<set name="friends" sort="unsorted" table="lien" lazy="true" cascade="all,delete-orphan">
<key Column="pere"/>
<many-to-many class="test.Node" column="enfants"/>
</ set>
[/ code]

Do not tell me that Sun has not thought about this possibility in removing cascade?


 Post subject:
PostPosted: Sun Jun 29, 2008 11:07 am 

Joined: Wed Jan 23, 2008 10:38 am
Posts: 1
If i no wrong, u use property in cascade is all and delete-orphan, that's mean u use all property of cascade like save-update and persist too..

and if u delete parent of cource your parent will be deleted and the child too.

 Post subject:
PostPosted: Fri Jul 04, 2008 10:32 am 

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Check out the JavaDoc for the CascadeType. It might shed some light on the situation:


Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.