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.
I think in the secondary table these columns aren't necessary, as when reading history, the secondary&primary tables are joined using the REV column. So as long as reading works fine, I think there is no problem.
Adam