Did you think about doing this in a custom AuditEventListener?
Here are some links about this:
Hope it helps. Hernán.
1 of 1 people found this helpful
Sure it's possible, just subclass AuditEventListener and overwrite some functions. More info in the FAQ: https://community.jboss.org/wiki/EnversFAQ
In the subclass there's nothing preventing you from e.g. reading a custom annotation on the class and executing the appropriate check method.
Hernan, Adam -- many thanks.
Yes, that's the approach I was thinking of as well.
I wonder if it would be worth it making the AuditEventListener pluggable, but for now conditional versioning is the only use case I can see. Not worth it I guess.
But the event listener is pluggable
Just specify your class, which overrides AEL in the hibernate configuration.