10.7.5.2. Enable or Disable Auditing at Runtime
Task Summary
This task covers the configuration steps required to enable/disable entity version auditing at runtime.
Procedure 10.10. Task
- Subclass the
AuditEventListener
class. - Override the following methods that are called on Hibernate events:
- onPostInsert
- onPostUpdate
- onPostDelete
- onPreUpdateCollection
- onPreRemoveCollection
- onPostRecreateCollection
- Specify the subclass as the listener for the events.
- Determine if the change should be audited.
- Pass the call to the superclass if the change should be audited.