![]() ![]() to pass the entity class names to be audited to the MetadataFactory instance. It also handles the case where there isn't a prior revision. The global revision table contains an id, timestamp, username and change. For each row that is inserted, updated or deleted in an audited table, one or more rows are inserted in the audit tables, along with the start revision of its validity. Here's another version that finds the previous revision relative to a "current" revision number, so it can be used even if the entity you're looking at isn't the latest revision. There are currently two audit strategies available with Hibernate Envers: Default Audit Strategy This strategy persists the audit data together with a start revision. (I'm very new to this, not sure if I have all the syntax right, maybe the size()-1 should be size()-2?) Solution 2 User user_previous = reader.find(User.class, user_rev1.getId(), List revNumbers = reader.getRevisions(User.class, user_rev1) User user_rev1 = reader.find(User.class, user.getId(), 1) Maybe this then (from AuditReader docs) AuditReader reader = AuditReaderFactory.get(entityManager)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |