Hibernate version: 3.2.1
Name and version of the database you are using: Oracle 10g R2
Hi,
We're starting a new application from scratch and we'll be using hibernate 3.2.1 for persistence. The database design was done before this choice was made, so now, I'm trying to request changes to the design.
The current design uses audit fields on every table. Those fields include last_updated, which has an Oracle type of DATE. Following the guidelines in the book, I'm planning to request the database designers to add a version field to every table, so that it can be used for optimistic concurrency control to avoid the problems associated with timestamps.
It seems, though, that the last_updated field has another use, which is auditing. So, probably, both fields need to live together.
I wonder if it's possible (or even correct) to specify both a version and timestamp tags inside a class.
Another approach would be to create a trigger for every table that would update the value of this field whenever the record is updated. But would hibernate be able to pickup this value?
Please advice.
Every help is appreciated.
|