Regular |
|
Joined: Tue Oct 07, 2003 1:13 pm Posts: 70 Location: Paris, France
|
One of my customers would need to log every value change for auditable entities.
Table A (field1, field2)
The event "The value of field1 has changed" would trigger the insert of an auditlog record with the following attributes :
- Entity
- Field
- OldValue
- NewValue
So by starting from the AuditLogInterceptor, I could say it's possible because we have for example in the onFlushDirty the old and new values. But knowing Hibernate already does the job when generating an update query on only the fileds whose value has changed, I can assume the mechanism is already there. Can I take advantage easily of the Hibernate core functions to retrieve the field whose the value has changed ? What would be the best practice ?
Thank you for your help.
Richard.
|
|