Hello.
I'm working on a system where some objects need to keep history information whenever they are changed.
Their primary key is composed by a number which identify the entity and a version number.
What I would like to do is to configure the persistence layer so that when a user calls versionObject.setSomething() the object's version is incremented and a copy of it's old status is created on it's table.
This is not possible using triggers, becuse inserting in the table during trigger execution causes the trigger tomalfunction.
I believe this could be done if I could redirect the update parameters to a stored procedure and let it do the update.
I'm using Oracle 9i.
This must not be done using any hibernate specific features. JPA compatibility must be assured.
Thanks in advance for any help,
Hugo Oliveira
hugom.oliveira.ext@siemens.com