diff --git a/documentation/envers/src/main/docbook/en-US/content/configuration.xml b/documentation/envers/src/main/docbook/en-US/content/configuration.xml index 17e698ba72..0c8914fb2e 100644 --- a/documentation/envers/src/main/docbook/en-US/content/configuration.xml +++ b/documentation/envers/src/main/docbook/en-US/content/configuration.xml @@ -157,11 +157,11 @@ <!-- other hibernate properties --> <property name="hibernate.ejb.event.post-insert" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.post-update" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.post-delete" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.pre-collection-update" value="org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.pre-collection-remove" @@ -175,6 +175,11 @@ </properties> </persistence-unit> + + The EJB3Post...EvenListeners are needed, so that ejb3 entity lifecycle callback + methods work (@PostPersist, @PostUpdate, @PostRemove. + + You can also set the name of the audit table on a per-entity basis, using the @AuditTable annotation. It may be tedious to add this diff --git a/documentation/envers/src/main/docbook/en-US/content/quickstart.xml b/documentation/envers/src/main/docbook/en-US/content/quickstart.xml index 37ec551320..b5ee802b7b 100644 --- a/documentation/envers/src/main/docbook/en-US/content/quickstart.xml +++ b/documentation/envers/src/main/docbook/en-US/content/quickstart.xml @@ -42,11 +42,11 @@ <!-- other hibernate properties --> <property name="hibernate.ejb.event.post-insert" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.post-update" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.post-delete" - value="org.hibernate.envers.event.AuditEventListener" /> + value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.pre-collection-update" value="org.hibernate.envers.event.AuditEventListener" /> <property name="hibernate.ejb.event.pre-collection-remove" @@ -56,6 +56,11 @@ </properties> </persistence-unit> + + The EJB3Post...EvenListeners are needed, so that ejb3 entity lifecycle callback + methods work (@PostPersist, @PostUpdate, @PostRemove. + + Then, annotate your persistent class with @Audited - this will make all properties audited. For example: