Envers Publisher's description
from Adam Warski
A library that aims to enable easy versioning of persistent JPA classes.
Envers is a library that aims to enable easy versioning of persistent JPA classes. All that you have to do is annotate your persistent class or some of its properties, that you want to version, with @Versioned. For each versioned entity, a table will be created, which will hold the history of changes made to the entity. You can then retrieve and query historical data without much effort.
Similarly to Subversion, the library has a concept of revisions. Basically, one transaction commit is one revision (unless the transaction didn't modify any versioned entities). As the revisions are global, having a revision number, you can query for various entities at that revision, retrieving a (partial) view of the database at that revision.
The library works with Hibernate and Hibernate Entity Manager (see hibernate.org). For the versioning to work properly, the entities must have immutable unique identifiers (primary keys). You can use Envers wherever Hibernate works: standalone, inside JBoss AS, with JBoss Seam or Spring.
In the future, the library will support versioning of arbitrary relationships. It will also include support for "revisioning groups", which will de-centralize the revisions table, if there are independend groups of entities versioned. Another important space-saving feature will be the possibility to store only diffs between revisions, not whole properties (this of course applies only to strings and byte arrays).
Here are some key features of "Envers":
В· versioning of basic properties (strings, integers, longs...)
В· versioning of embedded components, which are composed of basic properties
В· versioning of classes with simple, composite and embedded ids
В· versioning of one-to-one uni- (only on the owning side) and bi-directional relations
В· versioning of one-to-many uni- (only on the owning side) and bi-directional relations
В· support for secondary tables
В· logging data for each revision using a "revision entity"
В· querying historical data
What's New in This Release:В· It is mainly a bugfix release, but there is also one new feature. You can now access the current revision entity directly using AuditReader, without the need to use a revisions listener.
System Requirements:В· Java Runtime Environment
Program Release Status: Minor Update
Program Install Support: Install and Uninstall