Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Commits List »

[hibernate-commits] Hibernate SVN: r20217 -
 core/trunk/documentation/envers/src/main/docbook/en-US/content.

hibernate-commits

2010-08-22


Author LoginPost Reply
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) @@
&lt;/persistence-unit&gt;</programlisting>

  <para>
+  If you're using Hibernate directly, add the following to <literal>hibernate.cfg.xml</literal>:
+   </para>
+   <programlisting>
+  &lt;hibernate-configuration&gt;
+  &lt;session-factory&gt;
+
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/&gt;
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/&gt;
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/&gt;
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/&gt;
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/&gt;
+  &lt;listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/&gt;
+
+
+  &lt;/session-factory&gt;
+  &lt;/hibernate-configuration&gt;
+   </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
©2008 gg3721.com - Jax Systems, LLC, U.S.A.