DefaultRevisionEntity
DefaultRevisionEntity is a core class provided by Hibernate Envers, a module of the Hibernate ORM framework that implements auditing and versioning of entity data. It represents a minimal revision entity that tracks changes made to persistent objects over time. The class contains three primary fields: revisionNumber, revisionTimestamp, and a generated identifier. The revisionNumber is an auto‑incremented value that uniquely identifies each revision. The revisionTimestamp holds the epoch time in milliseconds when the revision was created. The identifier field is a primary key coordinating with Hibernate's automatic identifier strategy.
When an entity is annotated with @Audited, Envers records a row in a separate revision table. The
Developers may replace DefaultRevisionEntity with a custom subclass to add domain‑specific information. For instance, a subclass
In summary, DefaultRevisionEntity is a lightweight audit base class that supplies essential revision metadata for Hibernate