Interface RevisionedEntity<ID>
-
- Type Parameters:
ID
- is the type of theprimary key
.
- All Superinterfaces:
GenericEntity<ID>
,Serializable
- All Known Subinterfaces:
RevisionedPersistenceEntity<ID>
- All Known Implementing Classes:
RevisionedEto
public interface RevisionedEntity<ID> extends GenericEntity<ID>
This is the interface for aGenericEntity
that is (potentially) revision-controlled. Frameworks likehibernate-envers
(look for@Audited
annotation onJPA entities
) orbi-temporal
can manage such entities so all changes are stored in the database as a revision history. An instance of this interface represents therevision
of theentity
. There are two cases to distinguish:latest revision
ARevisionedEntity
pointing toLATEST_REVISION
(null
) represents the latest state of the entity and can be modified.- historic
revision
If the object isrevision controlled
, it has a history of modifications. ARevisionedEntity
can represent a historicrevision
out of this history. It therefore is immutable so operations to modify theRevisionedEntity
will typically fail.
- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static Number
LATEST_REVISION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Number
getRevision()
This method gets the revision of this entity.void
setRevision(Number revision)
This method sets therevision
of this entity.-
Methods inherited from interface com.devonfw.module.basic.common.api.entity.GenericEntity
getId, getModificationCounter, setId, setModificationCounter
-
-
-
-
Field Detail
-
LATEST_REVISION
static final Number LATEST_REVISION
-
-
Method Detail
-
getRevision
Number getRevision()
This method gets the revision of this entity. Thelatest revision
of an entity will always returnnull
. Otherwise this object is a historic entity and it will be read-only so modifications are NOT permitted.- Returns:
- the revision or
LATEST_REVISION
(null
) if this is the latest revision.
-
setRevision
void setRevision(Number revision)
This method sets therevision
of this entity.
ATTENTION:
This operation should only be used in specific cases and if you are aware of what you are doing as this attribute is managed by the persistence. However, for final freedom we decided to add this method to the API (e.g. to copy from transfer-object to persistent-entity and vice-versa).- Parameters:
revision
- is the new value ofgetRevision()
.
-
-