Author: adamw
Date: 2010-08-22 06:28:50 -0400 (Sun, 22 Aug 2010)
New Revision: 20217
Modified:
core/trunk/documentation/envers/src/main/docbook/en-US/content/quickstart.xml
Log:
HHH-5197:
quickstart covers also direct Hibernate usage
Modified: core/trunk/documentation/envers/src/main/docbook/en-US/content/quickstart.xml
===================================================================
--- core/trunk/documentation/envers/src/main/docbook/en-US/content/quickstart.xml 2010-08-22 10:15:05 UTC (rev 20216)
+++ core/trunk/documentation/envers/src/main/docbook/en-US/content/quickstart.xml 2010-08-22 10:28:50 UTC (rev 20217)
@@(protected) @@
<title>Quickstart</title>
<para>
- When configuring your Hibernate (<literal>persistence.xml</literal> if you are using JPA,
- <literal>hibernate.cfg.xml</literal> or other if you are using Hibernate directly), add the following event
+ If you're using JPA, when coniguring Hibernate (in <literal>persistence.xml</literal>), add the following event
listeners: (this will allow Envers to check if any audited entities were modified)
</para>
@@(protected) @@
</persistence-unit></programlisting>
<para>
+ If you're using Hibernate directly, add the following to <literal>hibernate.cfg.xml</literal>:
+ </para>
+ <programlisting>
+ <hibernate-configuration>
+ <session-factory>
+
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="post-update"/>
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
+ <listener class="
org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>
+
+
+ </session-factory>
+ </hibernate-configuration>
+ </programlisting>
+ <para>
The <literal>EJB3Post...EvenListener</literal>s are needed, so that ejb3 entity lifecycle callback
methods work (<literal>@(protected)>.
</para>
@@(protected) @@
</para>
</chapter>
+
_______________________________________________
hibernate-commits mailing list
hibernate-commits@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-commits