-
1. Re: Enhance audit entity with additional properties ?
azagorneanu Dec 27, 2010 7:32 AM (in response to dokmatik)Maybe this will help you: http://docs.jboss.org/hibernate/envers/3.6/reference/en-US/html_single/#revisionlog
-
2. Re: Enhance audit entity with additional properties ?
dokmatik Dec 27, 2010 3:59 PM (in response to azagorneanu)hi,
thank you for your hint on revision logs. I am aware of revision logs but they might be actually be a workaround to my requirement.
Rather, I am looking for valid options to attach additional properties / data to audited entities locally.
So far I understand that Envers dynamically generates persistent audit entities using the "map entity mode" at some point of initialization of the session factory. So I guess there must be some way to add additional properties to such metadata maps. Furthermore, I'd expect to extend the default AuditListener by a custom implementation in order to fill these properties at runtime when auditing is performed.
Am I heading into the right direction ?
Regards
dokmatik
-
3. Re: Enhance audit entity with additional properties ?
adamw Dec 30, 2010 8:09 AM (in response to dokmatik)There's no built-in way to add properties to the audit entities, so you would have to modify the Envers source code. If you'd like to do that, then you are heading in the right direction: during the initial configuration, new entities are created using the map entity mode, and then filled with data in *WorkUnit-s created in the AuditListener.
However so far revision logs worked for the use cases that I encountered . What's your use-case?
Adam