-->
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: cascade="all-delete-orphan" while calling SaveOrUp
PostPosted: Thu May 15, 2008 1:59 am 
Newbie

Joined: Wed May 14, 2008 9:53 am
Posts: 1
I need to save a copy of an object into the database for which i am using SaveOrUpdateCopy() which saves an exact replica of the object to the database. But this function does not allow cascade="all-delete-orphan" for the bags mentioned in the hbm.xml file of that object. So we changed all the cascade="all-delete-orphan" properties to cascade="all" in the hbm.xml for that object. Which works fine and a copy is saved to the database.

But we have a lot of IList (collections) as properties in that object we are trying to save. Cascade="all-delete-orphan" helps us delete the row in the database if one object in an IList is removed. But cascade="all" does not do that and that record presists in the database even if it has been removed from the IList. And we have to make an explicit delete method call to delete that object once we remove it from the List. Making an explicit delete method call is not something that we want to do. We want the Spring-Nibernate framework to do the save-update-delete and not make explicit delete call.

Can anyone help me on this as to use cascade="all-delete-orphan" property while using SaveOrUpdateCopy() function? We dont want to use cascade="all". This is an urgent requirement for the project.


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.