Conditional Auditing through class-level annotations

Description

The current conditional auditing solution works but its somewhat intrusive. It requires users to register their own Hibernate listeners and implement their own hooks on whether to audit a particular entity or not. This works, but such a solution could easily be standardized.

Consider the notion of introducing a new annotation, @AuditListener. This annotation is much like its JPA counterpart, @EventListener. The annotation allows specifying a class that is to act as a callback mechanism.

The various methods of the specified class allow users to inspect the state of the entity during the various event life cycles used by Envers. The code users were expected to put inside the custom event listeners can now be moved to these callback classes instead, eliminating users from having to manipulate with event listener registration.

Environment

None

Assignee

Chris Cranford

Reporter

Chris Cranford

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure