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:
parent
1553578808
commit
01a818a0ec
|
@ -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></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>
|
||||
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
|
||||
|
|
|
@ -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></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>
|
||||
Then, annotate your persistent class with <literal>@Audited</literal> - this will make all
|
||||
properties audited. For example:
|
||||
|
|
Loading…
Reference in New Issue