-->
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: delete-orphan vs all-delete-orphan
PostPosted: Tue Apr 26, 2005 10:06 am 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
Hibernate version:

2.1.8

I'm trying to figure out cascade="delete-orphan".

I have a set with cascade="delete-orphan" and when I remove something from it and call saveOrUpdate on the owner of the set, it removes the entity but doesn't delete it.

If I set cascade="all-delete-orphan" it does delete it.

I took a look in the code and it seems that the CascadeStyle for "delete-orphan" only passes cascades on ACTION_DELETE. Since I'm not deleting the parent, the cascade never makes it to the orphaned object so the special case code which checks cascadeStyle.hasOrphanDelete never gets called.

So, it seems that cascade "delete-orhpan" is no different than "delete"?

Does that seem right?

-mp


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 10:08 am 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
ps. I have noticed that delete-orphan isn't mentioned in the docs. Should I ignore the fact that it's specified in the dtd?

<!ATTLIST set cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED>


Top
 Profile  
 
 Post subject: did you ever get an answer for this one?
PostPosted: Wed Dec 21, 2005 2:19 pm 
Regular
Regular

Joined: Fri Jan 28, 2005 3:11 am
Posts: 81
did you ever get an answer for this one?


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.