We essentially have multiple objects in our model and some objects extend an EffectiveEntity to signify that they are constrained by what is necessary for effective dating.
This means the following: INSERT 1) A new record is a default insert.
DELETE 1) A delete is actually an update, updating the expDate.
UPDATE - The most complicate 1) A record has been updated. 2) Use the record information to do a get on the original record (previous state). 3) Run an update on the original record to change its expDate (expiring that record). 4) Take the record that was updated (from step 1) and detach it. 5) Make the detached object insertable (also update the effDate). 6) Run an insert on this new effDated record. - So I updated the original record to make it ineffective and inserted the newly effective record.
Is this something I can use Hibernate Interceptors to do so that I can intercept an update command and run an effective dated update/insert?
Thanks,
Jay
|