-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate envers is not auditing
PostPosted: Sun Oct 13, 2013 4:12 pm 
Newbie

Joined: Sat Nov 26, 2005 9:03 am
Posts: 5
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;
   }

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.