Home

RevisionEntity

RevisionEntity is a concept used in Hibernate Envers, a module for auditing changes to JPA and Hibernate entities. A revision entity represents the metadata associated with a single revision or audit event. It is defined as a JPA entity annotated with @RevisionEntity and is responsible for persisting revision-level information such as an identifier and a timestamp.

By default, Envers provides a base revision entity (often named DefaultRevisionEntity) that stores core revision data.

Fields commonly associated with a revision entity include a revision number and a revision timestamp. These

Extensibility is a key feature: developers can add custom metadata to a revision entity, enabling richer audit

See also: Hibernate Envers, RevisionListener, DefaultRevisionEntity, @RevisionEntity, @RevisionNumber, @RevisionTimestamp.

Developers
can
use
this
default
structure
or
define
a
custom
revision
entity
by
extending
the
base
class
or
creating
a
new
entity
and
marking
it
with
@RevisionEntity.
A
revision
entity
can
specify
a
RevisionListener,
which
implements
the
RevisionListener
interface
to
populate
fields
when
a
new
revision
is
created,
for
example
by
capturing
the
current
user
or
application
context.
fields
are
typically
annotated
with
@RevisionNumber
and
@RevisionTimestamp,
respectively.
The
revision
entity
is
stored
in
a
revision
information
table
(often
REVINFO),
and
each
audited
change
in
audited
entities
is
linked
to
a
specific
revision
via
references
in
the
corresponding
audit
tables
(e.g.,
Entity_AUD)
that
reference
the
revision
identifier.
trails.
This
allows
organizations
to
include
contextual
information
such
as
user
identifiers,
application
components,
or
security
details
alongside
each
revision.