Hi,
I am using spring 3.2.4 and hibernate 3.6.10.Final core, entiymanager and envers but it is not auditing to the audit table when the object is updated. Can anyone please tell me what im doing wrong?
Many thanks
Dave.
Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="packagesToScan" value="com.sts.domain"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.use_sql_comments">${hibernate.use_sql_comments}</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
<prop key="hibernate.default_batch_fetch_size">${hibernate.default_batch_fetch_size}</prop>
<prop key="hibernate.query.factory_class">${hibernate.query.factory_class}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
<prop key="hibernate.cache.use_structured_entries">${hibernate.cache.use_structured_entries}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="hibernate.order_inserts">${hibernate.order_inserts}</prop>
<prop key="hibernate.order_updates">${hibernate.order_updates}</prop>
<prop key="hibernate.ejb.event.post-insert">org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.post-update">org.hibernate.envers.event.AuditEventListener</prop>
<prop key="hibernate.ejb.event.post-delete">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>
</props>
</property>
<property name="namingStrategy">
<ref bean="namingStrategy"/>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="entityInterceptor">
<ref local="stsDomainInterceptor"/>
</property>
</bean>
@Audited
@Entity
public class Term extends AbstractUpdatedBy {
private static final long serialVersionUID = 5730959730455584084L;
@Type(type="org.joda.time.contrib.hibernate.PersistentLocalDateTime")
@Column(nullable = false, updatable = false)
private LocalDateTime dateFrom;
public LocalDateTime getDateFrom() {
return dateFrom;
}
public void setDateFrom(LocalDateTime dateFrom) {
this.dateFrom = dateFrom;
}
}