From 01a818a0ec6e80fff057dc186f318bbd9a2efbfc Mon Sep 17 00:00:00 2001 From: Adam Warski Date: Thu, 30 Apr 2009 05:53:15 +0000 Subject: [PATCH] HHH-3879: - updating the docs with information on default listeners that should be included so that ejb3 lifecycle callback methods work git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@16484 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../src/main/docbook/en-US/content/configuration.xml | 11 ++++++++--- .../src/main/docbook/en-US/content/quickstart.xml | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) 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: