Type: Feature Request
Status: Open (View Workflow)
The Envers project aims to enable easy auditing/versioning of persistent classes. All that you have to do is annotate your persistent class or some of its properties, that you want to audit, with @Audited. For each audited entity, a table will be created, which will hold the history of changes made to the entity. You can then retrieve and query historical data without much effort.
Adam Warski has explains the steps required to add Envers to a basic Forge project.
Here are a suggested list of commands:
1. Setup Envers (add the dependency to pom.xml):
setup envers --bundle (optional variant that sets the scope to compile instead of provided for servers other than AS 7)
2. Add @Audited to an entity class (auto-complete @Entity classes only)
3. Add @Audited to a field (only available in the context of an @Entity class)
audit-field --named lastName
For more ideas, see the reference guide: http://docs.jboss.org/hibernate/envers/3.6/reference/en-US/html/