Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.1
Name and version of the database you are using:
Oracle 9i
I want to keep a trace of deleted records in my db :
Tables
Code:
A(id, removed_flag)
B(id, a_id, removed_flag)
Records
Code:
A(1, false)
A(2, false)
B(1, 1, false)
B(1, 2, false)
After deleting A(1)
Code:
A(1, true)
A(2, false)
B(1, 1, true)
B(1, 2, false)
I saw that you can specify a where clause for fetching records from the db. Could 'where removed_flag=false' be used in combination with an interceptor that does not delete records but sets the flag instead ?
Or is there any other standard approach for modelling this kind of behaviour ? I guess you could also use some kind of database trigger, but I'm not too familiar with triggers...
Many thanks for all your comments,
Kristof