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
This commit is contained in:
Adam Warski 2009-04-30 05:53:15 +00:00
parent 1553578808
commit 01a818a0ec
2 changed files with 16 additions and 6 deletions

View File

@ -157,11 +157,11 @@
<!-- other hibernate properties --> <!-- other hibernate properties -->
<property name="hibernate.ejb.event.post-insert" <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" <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" <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" <property name="hibernate.ejb.event.pre-collection-update"
value="org.hibernate.envers.event.AuditEventListener" /> value="org.hibernate.envers.event.AuditEventListener" />
<property name="hibernate.ejb.event.pre-collection-remove" <property name="hibernate.ejb.event.pre-collection-remove"
@ -175,6 +175,11 @@
</properties> </properties>
&lt;/persistence-unit&gt;</programlisting> &lt;/persistence-unit&gt;</programlisting>
<para>
The <literal>EJB3Post...EvenListener</literal>s are needed, so that ejb3 entity lifecycle callback
methods work (<literal>@PostPersist, @PostUpdate, @PostRemove</literal>.
</para>
<para> <para>
You can also set the name of the audit table on a per-entity basis, using the You can also set the name of the audit table on a per-entity basis, using the
<literal>@AuditTable</literal> annotation. It may be tedious to add this <literal>@AuditTable</literal> annotation. It may be tedious to add this

View File

@ -42,11 +42,11 @@
&lt;!-- other hibernate properties --&gt; &lt;!-- other hibernate properties --&gt;
&lt;property name="hibernate.ejb.event.post-insert" &lt;property name="hibernate.ejb.event.post-insert"
value="org.hibernate.envers.event.AuditEventListener" /&gt; value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener" /&gt;
&lt;property name="hibernate.ejb.event.post-update" &lt;property name="hibernate.ejb.event.post-update"
value="org.hibernate.envers.event.AuditEventListener" /&gt; value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" /&gt;
&lt;property name="hibernate.ejb.event.post-delete" &lt;property name="hibernate.ejb.event.post-delete"
value="org.hibernate.envers.event.AuditEventListener" /&gt; value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener" /&gt;
&lt;property name="hibernate.ejb.event.pre-collection-update" &lt;property name="hibernate.ejb.event.pre-collection-update"
value="org.hibernate.envers.event.AuditEventListener" /&gt; value="org.hibernate.envers.event.AuditEventListener" /&gt;
&lt;property name="hibernate.ejb.event.pre-collection-remove" &lt;property name="hibernate.ejb.event.pre-collection-remove"
@ -56,6 +56,11 @@
&lt;/properties&gt; &lt;/properties&gt;
&lt;/persistence-unit&gt;</programlisting> &lt;/persistence-unit&gt;</programlisting>
<para>
The <literal>EJB3Post...EvenListener</literal>s are needed, so that ejb3 entity lifecycle callback
methods work (<literal>@PostPersist, @PostUpdate, @PostRemove</literal>.
</para>
<para> <para>
Then, annotate your persistent class with <literal>@Audited</literal> - this will make all Then, annotate your persistent class with <literal>@Audited</literal> - this will make all
properties audited. For example: properties audited. For example: