Bypassing JPA update in favor of stored procedure

Hello.

In the application I'm working on there's the need in some cases to keep an history of the objects status throughout their live cycle. In order to do this, the tables related to the historically relevant entities have a version column.

Everytime an instance of one of these objects is modified, a copy of it's status previous to the update must be inserted into the table. The instances version is incremented and the update to it's fields is carried on.

Due to a shortcoming of the update triggers in Oracle, we can't have a trigger to insert the new row before updating the new object's status, thus creating the need to use a stored procedure.

As you may hava already gessed, what I want to know is how I can configure my entities so that updates to their instances are sent to the proper stored procedure instead of the JPA's default update mechanism.

Thanks in advance,

Hugo Oliveira

hugom.oliveira.ext@siemens.com

[984 byte] By [Hugo_Oliveiraa] at [2007-11-26 17:07:59]
# 1
Just in case you haven't any answer, check this Oracle implementation: http://forums.oracle.com/forums/message.jspa?messageID=1255706
pedro.solorzanoa at 2007-7-8 23:35:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...