-->
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: Special update cascading behavior
PostPosted: Tue Feb 23, 2010 6:07 am 
Newbie

Joined: Tue Feb 23, 2010 5:58 am
Posts: 1
Hi,
I'm trying to implement a special database behavior where when an object is deleted it isn't really removed from the database but a special column on the object is updated to indicate that this object is no longer present.
The problem is that I need this "deleted" attribute to be cascaded to all its "owned" sub-objects.
Example: If I have a "Item" object and it contains a container of "Bid" objects I need the "deleted" attribute to be enabled on all bids if the Item object is deleted.
Since this is a pattern on all my objects I am trying to solve this in a generic way.
If anyone has an idea on how such a thing can be implemented it will be great help.
I've implemented instead of the "remove" method of Hibernate a private "MyRemove" which updates the object's "deleted" column but I need a way to find all the sub-objects like the Hibernate cascading feature does.
Thanks in advance,
Avner


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.