1 Reply Latest reply on Dec 15, 2011 10:01 AM by adamw

    In tables "_AUD" columns revtype and revend not created

    jeveloper

      Mapping:

       

      @Entity

      @Audited

      @Inheritance(strategy = InheritanceType.SINGLE_TABLE)

      @DiscriminatorColumn(name="objTables", discriminatorType=DiscriminatorType.STRING)

      abstract public class ObjEntityReference {

      .....}

       

      @MappedSuperclass

      abstract public class ComplexEntity extends ObjEntityReference {

      .....}

       

       

      @Entity

      @Audited

      @SecondaryTable(name = "BGD_CONTEXT")

      public class Context extends ComplexEntity {

         @Column(table = "BGD_CONTEXT", nullable = false)

          private String name;

       

           ..........................

      }

       

      Hibernate creates tables "_aud" automatically, but columns revtype and revend in them not present.

       

      SQL TABLE: select * from BGD_CONTEXT_AUD

       

      +----+-----+---------+

      | id | REV |  name

      +----+-----+---------+

      |  1 |     1 |     test

      +----+-----+---------+

       

      For simple Entity, without inheritance use @Inheritance(strategy = InheritanceType.SINGLE_TABLE) and @SecondaryTable, these columns(revtype, revend) are created. But all my project is created on the basis of the given strategy of inheritance. Whether it is possible in given cases to use ENVERS and how it to make?

       

      hibernate 3.6.8.Final

      envers 3.6.8.Final

       

      Forgive, badly I know English language. Please help.