-
1. Re: Conditional versioning
hernanbolido Mar 25, 2010 3:51 PM (in response to maciejb)Hi!
Did you think about doing this in a custom AuditEventListener?
Here are some links about this:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3559
http://community.jboss.org/wiki/EnversFAQ
Hope it helps. Hernán.
-
2. Re: Conditional versioning
adamw Mar 25, 2010 4:55 PM (in response to maciejb)1 of 1 people found this helpfulSure 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.
Adam
-
3. Re: Conditional versioning
maciejb Mar 25, 2010 7:12 PM (in response to maciejb)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.
-
4. Re: Conditional versioning
adamw Mar 26, 2010 10:39 AM (in response to maciejb)But the event listener is pluggable
Just specify your class, which overrides AEL in the hibernate configuration.
Adam