-->
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: Cascading deletes on detached objects
PostPosted: Sun May 11, 2008 9:51 pm 
Newbie

Joined: Thu Oct 25, 2007 2:20 am
Posts: 3
Location: Australia
Is there anyone that can tell me the best way to handle cascading deletes for detached objects? i.e. i want the deleted objects in a composite collection to be persisted.

It's my understanding that the only way to get hibernate to cascade deletes on a detached object is to use session.merge instead of session.update. Unfortunately, this has the unwanted side effect of not reflecting updated timestamp values in the parent object.

I've posted more details on the issue here:
http://www.jmpj.net/jason/index.cfm/200 ... and-tricks

I'm caught in a paradox. If I use merge I have to manually refresh my object to retrieve the new timestamp. If I use update i have to manually cascade any deleted collection elements.

_________________
---------------------------------------------------
Jason Sheedy
www.bytespring.com
www.jmpj.net
---------------------------------------------------


Top
 Profile  
 
 Post subject: questions
PostPosted: Tue May 13, 2008 6:58 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Hi,
Can you pls post a piece of test code on how you expect to persist your composite entity?


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.