使用 Hibernate Envers,是否可以获得当前已审计的表?我从文档中获取了示例,但我添加了一个额外的列tableName
:
@Entity
@RevisionEntity(ExampleListener.class)
public class ExampleRevEntity extends DefaultRevisionEntity {
private String username;
private tableName;
...
}
和听众:
public class ExampleListener implements RevisionListener {
public void newRevision(Object revisionEntity) {
ExampleRevEntity exampleRevEntity = (ExampleRevEntity) revisionEntity;
...
exampleRevEntity.setUsername(...);
exampleRevEntity.setTableName(...); // How to get the current table audited table?
}
}
我发现这篇旧帖子Get audit table name from hibernate envers? 但没有相关的答案。非常感谢