I'm using Hibernate-Core:4.3.11.Final and Hibernate-Envers:4.3.11.Final and I have my implementation of org.hibernate.envers.RevisionListener
and I have my revision entity(MyRevisionEntity) which extend org.hibernate.envers.DefaultRevisionEntity but envers still using default org.hibernate.envers.DefaultRevisionEntity.
Code:
public class MyRevisionListener implements RevisionListener {
@Override
public void newRevision(Object o) {
MyRevisionEntity myRev = (MyRevisionEntity) o;
..
}
}
Code:
@Entity
@Table(name = "my_revision")
@RevisionEntity(MyRevisionListener.class)
public class MyRevisionEntity extends DefaultRevisionEntity {
}
What I'm doing wrong?
Then on documentation I find:
Quote:
If your RevisionListener class is inaccessible from @RevisionEntity (e.g. exists in a different module), set org.hibernate.envers.revision_listener property to it's fully qualified name. Class name defined by the configuration parameter overrides revision entity's value attribute.
so I add: org.hibernate.envers.revision_listener: db.MyRevisionListener
but then I get error:
---------------------------
java.lang.ClassCastException: org.hibernate.envers.DefaultRevisionEntity cannot be cast to db.MyRevisionEntity
It is very strange because MyRevisionEntity extend DefaultRevisionEntity .
Any idea?
Regards, Tomaz