ID
- is the type of the primary key
.public interface RevisionedEntity<ID> extends GenericEntity<ID>
GenericEntity
that is (potentially) revision-controlled. Frameworks like
hibernate-envers
(look for @Audited
annotation on JPA entities
) or
bi-temporal
can manage such entities so all changes are stored in the database as a revision history. An
instance of this interface represents the revision
of the entity
. There
are two cases to distinguish:
latest revision
RevisionedEntity
pointing to LATEST_REVISION
(null
) represents the latest state of the
entity and can be modified.revision
revision controlled
, it has a history of modifications. A
RevisionedEntity
can represent a historic revision
out of this history. It therefore
is immutable so operations to modify the RevisionedEntity
will typically fail.Modifier and Type | Field and Description |
---|---|
static Number |
LATEST_REVISION
|
Modifier and Type | Method and Description |
---|---|
Number |
getRevision()
This method gets the revision of this entity.
|
void |
setRevision(Number revision)
This method sets the
revision of this entity. |
getId, getModificationCounter, setId, setModificationCounter
static final Number LATEST_REVISION
Number getRevision()
latest revision
of an
entity will always return null
. Otherwise this object is a historic entity and it will be
read-only so modifications are NOT permitted.LATEST_REVISION
(null
) if this is the latest revision.void setRevision(Number revision)
revision
of this entity. revision
- is the new value of getRevision()
.Copyright © 2014–2019 devon4j-Team. All rights reserved.