7 Replies Latest reply on Jan 28, 2009 12:29 PM by Adam Warski

    Inheritance Problem

    Nuno Ochoa Newbie

      Hi,

      I'm currently evaluating Envers and i'm getting a strange problem ...

      I have an example with a very simple domain:

      @Entity
      @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
      @Audited
      public abstract class Test {
      
       @Id
       @GeneratedValue
       private long id;
      
       private Integer a;
      
       public Test() {
      
       }
      
       public void setId(long id) {
       this.id = id;
       }
      
       public long getId() {
       return id;
       }
      
       public void setA(Integer a) {
       this.a = a;
       }
      
       public Integer getA() {
       return a;
       }
      }
      
      
      @Entity
      @Audited
      public class TestExtend extends Test {
      
       private String b;
      
       public TestExtend() {
      
       }
      
       public void setB(String b) {
       this.b = b;
       }
      
       public String getB() {
       return b;
       }
      }
      


      When I use Hibernate 3.3.1 with envers 1.1.0 for Hibernate 3.3 it all goes well.
      If I upgrade envers to 3.4 preview version, all tables are correctly created but when I create a new TestExtend object, it's persisted but not versioned, including other non related entities.
      Does anyone have an idea on what might be the problem?

      Thanks!!