org.hibernate.ejb.event.EJB3PostUpdateEventListener,
org.hibernate.envers.event.AuditEventListener
</prop>
<prop key="hibernate.ejb.event.post-delete">
org.hibernate.ejb.event.EJB3PostDeleteEventListener,
org.hibernate.envers.event.AuditEventListener
</prop>
<prop key="hibernate.ejb.event.pre-collection-update">
org.hibernate.envers.event.AuditEventListener
</prop>
<prop key="hibernate.ejb.event.pre-collection-remove">
org.hibernate.envers.event.AuditEventListener
</prop>
<prop key="hibernate.ejb.event.post-collection-recreate">
org.hibernate.envers.event.AuditEventListener
</prop>
<!-- Properties for Hibernate Envers -->
<prop key="org.hibernate.envers.audit_table_suffix">_H</prop>
<prop key="org.hibernate.envers.revision_field_name">
AUDIT_REVISION
</prop>
<prop key="org.hibernate.envers.revision_type_field_name">
ACTION_TYPE
</prop>
<prop key="org.hibernate.envers.audit_strategy">
org.hibernate.envers.strategy.ValidityAuditStrategy
</prop>
<prop key="org.hibernate.envers.audit_strategy_validity_end_rev_field_name">
AUDIT_REVISION_END
</prop>
<prop key="org.hibernate.envers.audit_strategy_validity_store_revend_timestamp">
True
</prop>
<prop
key="org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name">
AUDIT_REVISION_END_TS
</prop>
</props>
</property>
</bean>
As shown in Listing 10-48, the Envers audit event listener
(org.hibernate.envers.event.AuditEventListener) is attached to various persistence events. The
listener intercepts the events post-insert, post-update, or post-delete and clones the pre-update image
of the entity class into the history table. The listener is also attached to those association update events
pre-collection-update, pre-collection-remove, and pre-collection-recreate for handling the update
operations of the entity class's associations. Envers is capable of keeping the history of the entities
within an association (e.g., one-to-many, many-to-many, and so on).
A few properties are also defined for Hibernate Envers, which are summarized in Table 10-6 (the
prefix of the properties, org.hibernate.envers, was omitted for clarity).
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home