I have several classes in my project that are processed by Hibernate, some are checked by Envers, some are not. Now, when I try to save a specific unaudited object, I get the following:
java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: audit_etc_etc)
Some might think that I simply do not have an audit table in my database, but Envers should not even try to look for this table, because the entity is not checked. My classes look like this:
@Entity
class A {
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
AuditedEntity e;
List<B> listOfBs;
}
@Entity
class B {
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
AuditedEntity e;
A anA;
List<C> listOfCs;
}
@Entity
class C {
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
AuditedEntity e;
B anB;
}
Thus, each class contains a list of children who have a link to their parent. None of these classes are marked with @Audited-nnotation, but they do have references to some validated objects. However, each of these links is marked with @Audited(targetAuditMode = RelationTargetAuditMode. NOT_AUDITED)-nnotation.
hibernate.cfg.xml , , -, .
?
(: A B, , C )
Update:
show_sql , B:
Hibernate: update table_b set all_attributes=? where idB=?
Hibernate: insert into audit_description (timestamp, description) values (?, ?)
Hibernate: insert into audit_table_b (revision_type, attributes, moreAttributes, revision) values (?, ?, ?, ?)