3 Replies Latest reply on Mar 16, 2012 12:56 AM by Adam Warski

    Envers doesn't create tables

    BBG BBG Newbie

      I use Glassfish 3.1.1 and Hibernate 4.1.1.

      Here is my persistence.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.0"
         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
              http://java.sun.com/xml/ns/persistence
              http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
         <persistence-unit name="primary" transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>JpaucDS</jta-data-source>
            <class>ru.mesotron.jpauc.domain.TestEnt</class>
            <properties>
              <!-- Hibernate config -->
              <property name="hibernate.show_sql"                value="true"/>
              <property name="hibernate.hbm2ddl.auto"            value="create-drop"/>
      
      
              <!-- Envers config -->
                             <property name="org.hibernate.envers.audit_table_prefix"       value="envers_"/>
                             <property name="org.hibernate.envers.audit_table_suffix"       value=""/>
              <property name="org.hibernate.envers.track_entities_changed_in_revision" value="true"/>
              <property name="org.hibernate.envers.audit_strategy"           value="org.hibernate.envers.strategy.ValidityAuditStrategy"/>
              <property name="org.hibernate.envers.audit_strategy_validity_store_revend_timestamp" value="true"/>
              <property name="org.hibernate.envers.revision_field_name"      value="revision"/>
              <property name="org.hibernate.envers.audit_strategy_validity_end_rev_field_name" value="revision_end"/>
              <property name="org.hibernate.envers.revision_type_field_name" value="revision_type"/>
              <property name="org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name" value="revision_end_timestamp"/>
              <property name="org.hibernate.envers.modified_flag_suffix" value="_mod"/>
                  </properties>
         </persistence-unit>
      </persistence>
      
      

       

      TestEnt is annotated with @Entity and @Audited.

      After deploy to the server there is only test_ent table in the database.

      Where are envers_test_ent and REVINFO tables?