3 Replies Latest reply on Oct 11, 2012 2:11 PM by Adam Warski

    EnversHibernateToolTask not generating audit tables

    gilberthuph Newbie

      I'm trying to generate my schema with the org.hibernate.tool.ant.EnversHibernateToolTask ant task; the schema is generated but missing the _aud tables for my @Audited classes.

       

      I'm using <jpaconfiguration persistenceunit="MyPU" /> with the following persistence.xml

       

      {code:xml}

          <persistence-unit name="MyPU">

              <provider>org.hibernate.ejb.HibernatePersistence</provider>

              <class>[ ... entities ... ]</class>

              <properties>

                  <property name="dialect" value="org.hibernate.dialect.PostgreSQL82Dialect"/>

                  <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>

                  <property name="hibernate.connection.url"

                            value="jdbc:postgresql://localhost/mtdb"/>

                  <property name="hibernate.connection.username" value="username"/>

                  <property name="hibernate.connection.password" value="xxxxxx"/>

                  <property name="hibernate.hbm2ddl.auto" value="validate"/>

                  <property name="hibernate.show_sql" value="true"/>

                  <property name="org.hibernate.envers.audit_table_suffix" value="_aud"/>

              </properties>

          </persistence-unit>  

      {code:xml}

       

      Any ideas why the audit tables are missing from the generated schema?