-->
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.  [ 4 posts ] 
Author Message
 Post subject: replacing delete with timestamp of a delete field
PostPosted: Thu Jun 09, 2005 11:45 am 
Newbie

Joined: Thu Sep 09, 2004 6:50 am
Posts: 15
I'd like to implement a replacement for delete.
It does everything exactly as delete does,
but instead of actually deleting the record (and
all of its cascades), it
just puts a current timestamp in
a field (that is in all my tables) called
"deleted". All my persistent objects
derive from a single AbstractPersistentObject
and this AbstractPersistentObject
has a field that maps to "deleted"

I then use a session filter to keep the delete out of
my real data. But that way I can have an
administrator, or someone with special
privileges have the capability of perusing
the deleted items.

Is this just an inherently bad idea?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 11:46 am 
Newbie

Joined: Thu Sep 09, 2004 6:50 am
Posts: 15
oh, and any pointers on where to start?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 3:41 am 
Newbie

Joined: Tue Mar 23, 2004 1:04 am
Posts: 3
Hello,
Your problem is very similar to our one as well as entire approach and application architecture. I would ask you, have you found the solution? Maybe you have found another way or something else?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 9:34 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Quote:
I then use a session filter to keep the delete out of
my real data. But that way I can have an
administrator, or someone with special
privileges have the capability of perusing
the deleted items.


That's how we solve this as well. You could even write your own sql for the delete. This way you can even delete the instances with session.delete(). See chapter 17.4 of the reference manual

HTH
Ernst


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.