- Add the envers jarfile to your project. To do this open your dependencies.yml file and add the following lines afther the -play entry:
- org.hibernate -> hibernate-envers 3.6.1.Final: transitive: false
I have added the transitive: false to ensure no other libs are added to my lib folder. I do not need these. - Stop your play project via the commandline and execute the command:
./play dependencies [Your-projectname-here] --verbose
The verbose is optional to see what Play is actually doing. This might be usesfull when play is not able to download the jarfile.
hibernate.ejb.event.post-insert=org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener hibernate.ejb.event.post-update=org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener hibernate.ejb.event.post-delete=org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener hibernate.ejb.event.pre-collection-update=org.hibernate.envers.event.AuditEventListener hibernate.ejb.event.pre-collection-remove=org.hibernate.envers.event.AuditEventListener hibernate.ejb.event.post-collection-recreate=org.hibernate.envers.event.AuditEventListener
- If needed update your eclipse project by calling the eclipsify command.
- We now have all required resources in place and can start annotating our Model classes with the @Audited annotations. For info on what you can do with this I suggest you take a look at the Hibernate manual envers section. You can find that here
Now you are ready to start working on your revisions. In the next post I'll work out a simple example using this approach.
Geen opmerkingen:
Een reactie posten