-
1. Re: What's the best way to implement audit fields in entities?
fernando_jmt Sep 8, 2008 3:03 PM (in response to magoicochea)If you want to audit your entities changes you can consider to use the project Envers. This project makes easy the audit process on entities state with just only straightforward annotations. I tried it out and it's good.
-
2. Re: What's the best way to implement audit fields in entities?
vladimir.kovalyuk Sep 8, 2008 4:28 PM (in response to magoicochea)Looks very interesting ...
But I doubt it can help with SMPC in manual flush mode. I should investigate this. -
3. Re: What's the best way to implement audit fields in entities?
gjeudy Sep 8, 2008 4:35 PM (in response to magoicochea)You can get ideas on how this can be done with either hibernate interceptor approach where you log full change in a separate audit table.
Or you can look at EJB3 listeners to update create tstamp and update tstamps on your entity.
I think create-onflush and merge are probably the events you are looking for for create and update respectively. On 2nd thought you can probably achieve create/update tstamps logic in a regular Hibernate interceptor, the choice is yours.
-
4. Re: What's the best way to implement audit fields in entities?
magoicochea Sep 8, 2008 6:40 PM (in response to magoicochea)Thanks for your help, I think that may be what I was looking for. I'm going to investigate about that and see if that fits what I want to do.