0 Replies Latest reply on Mar 31, 2014 1:21 AM by Łukasz Nowak

    Hibernate envers not generate tables audit

    Łukasz Nowak Newbie

      I have a problem with Envers, not work, not generate tables.

      I use version:

         <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
         <version>5.0.1.Final</version>
         </dependency>
         <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-commons-annotations</artifactId>
         <version>3.3.0.ga</version>
         </dependency>
         <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-annotations</artifactId>
         <version>3.3.1.GA</version>
         </dependency>
      
         <dependency>   
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>4.1.4.Final</version>
         </dependency>
         <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-entitymanager</artifactId>
         <version>4.1.4.Final</version>
         </dependency>
      
        <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-envers</artifactId>
         <version>4.1.9.Final</version>
         </dependency>
      

      And Sprign version: 3.2.6.RELEASE

      And my db config:

      <context:component-scan base-package="pl.com.web.service" />
      <context:property-placeholder
         location="classpath:pl/com/web/config/jdbc.properties" />
      
      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
         destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
         p:url="${jdbc.databaseurl}" p:username="${jdbc.username}" p:password="${jdbc.password}" />
      
      <bean id="sessionFactory"
         class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
         <property name="dataSource" ref="dataSource" />
         <property name="packagesToScan">
         <list>
         <value>pl.com.web.model</value>
         </list>
         </property>
      
         <property name="configurationClass">
         <value>org.hibernate.cfg.AnnotationConfiguration</value>
         </property>
         <property name="hibernateProperties">
         <props>
         <prop key="hibernate.dialect">${jdbc.dialect}</prop>
         <prop key="hibernate.show_sql">true</prop>
         <prop key="hibernate.hbm2ddl.auto">update</prop>
         </props>
         </property>
      
      </bean>
      
      <tx:annotation-driven transaction-manager="transactionManager"
         proxy-target-class="true" />
      <bean id="transactionManager"
         class="org.springframework.orm.hibernate3.HibernateTransactionManager">
         <property name="sessionFactory" ref="sessionFactory" />
      </bean>
      
      <bean id="exceptionTranslator"
         class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor">
      </bean>

       

      In version 4+ not need add listener to envers? and i add annotation @Audited to my entity, and it's not working. Where is the problem?