ID
- is the type of the primary key
.ENTITY
- is the type
of the managed entity.public interface RevisionedDao<ID,ENTITY extends RevisionedEntity<ID>> extends GenericDao<ID,ENTITY>
GenericDao
with the ability of revision-control. It organizes a
revision-history (journal) of the managed entities
.RevisionedEntity
Modifier and Type | Method and Description |
---|---|
Number |
createRevision(ENTITY entity)
This method creates a new
revision of the given entity. |
void |
delete(ENTITY entity)
This method deletes the given
entity from the persistent store. |
List<Number> |
getRevisionHistory(ENTITY entity)
|
List<RevisionMetadata> |
getRevisionHistoryMetadata(Object id)
This method will get the
List of RevisionMetadata from the
revision -history of the entity with the given id . |
ENTITY |
load(ID id,
Number revision)
This method loads a historic
revision of the
RevisionedEntity with the given id from the persistent store. |
create, deleteById, find, findIfExists, getEntityClass, getReference, save
List<Number> getRevisionHistory(ENTITY entity)
List
of historic revisions
before
the given entity
. If the given entity
is the
latest revision
... entity
is NOT revision controlled, an empty
list
is returned.entity
- is the according RevisionedEntity
.List
of historic revisions
.List<RevisionMetadata> getRevisionHistoryMetadata(Object id)
List
of RevisionMetadata
from the
revision
-history of the entity
with the given id
.id
- is the primary key
of the entity for which the
history-metadata is requested.List
of RevisionMetadata
.ENTITY load(ID id, Number revision) throws ObjectNotFoundException
revision
of the
RevisionedEntity
with the given id
from the persistent store. revision
is RevisionedEntity.LATEST_REVISION
the
latest revision will be loaded
. revision
numbering of the underlying
implementation. Please use getRevisionHistory(RevisionedEntity)
or
getRevisionHistoryMetadata(Object)
to find revision numbers.id
- is the primary key
of the requested entity
.revision
- is the revision
of the requested entity or
RevisionedEntity.LATEST_REVISION
to get the latest
revision. A
specific revision has to be greater than 0
.entity
.ObjectNotFoundException
- if the requested entity
could NOT be found.Number createRevision(ENTITY entity)
revision
of the given entity. The given
entity is saved and a copy is written to the revision-historyentity
- is the entity to create a new revision of.revision
of the created history-entry.void delete(ENTITY entity)
entity
from the persistent store. entity
is transient
this method has no effect. latest revision
of an entity will only move it to the history
while the deletion of a historic entity
is NOT permitted and will
cause a PersistenceException
.latest revision
of an entity will either move it to the history
orentity
is a historic entity
the
according historicdelete
in interface GenericDao<ID,ENTITY extends RevisionedEntity<ID>>
entity
- is the GenericEntity
to save.Copyright © 2001–2014 mmm-Team. All rights reserved.