Interface GenericRevisionedDao<ID,ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>
-
- Type Parameters:
ID
- is the type of theprimary key
.ENTITY
- is the type of the managed entity.
- All Superinterfaces:
com.devonfw.module.jpa.dataaccess.api.feature.FeatureForceIncrementModificationCounter<ENTITY>
,GenericDao<ID,ENTITY>
- All Known Subinterfaces:
RevisionedDao<ENTITY>
,RevisionedMasterDataDao<E>
- All Known Implementing Classes:
AbstractGenericRevisionedDao
,AbstractRevisionedDao
public interface GenericRevisionedDao<ID,ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>> extends GenericDao<ID,ENTITY>
This is the interface for aGenericDao
with the ability of revision-control. It organizes a revision-history (journal) of the managed entities.- See Also:
RevisionedEntity
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete(ENTITY entity)
The behavior of this method depends on the revision-control strategy of the implementation.List<Number>
getRevisionHistory(ID id)
This method will get theList
of historicrevisions
of theentity
with the givenid
.
If theentity
is NOT revision controlled, anempty list
is returned.List<com.devonfw.module.basic.common.api.RevisionMetadata>
getRevisionHistoryMetadata(Object id)
This method will get theList
ofRevisionMetadata
from therevision
-history of the entity with the givenid
.ENTITY
load(ID id, Number revision)
This method loads a historicrevision
of theRevisionedEntity
with the givenid
from the persistent store.
-
-
-
Method Detail
-
getRevisionHistory
List<Number> getRevisionHistory(ID id)
This method will get theList
of historicrevisions
of theentity
with the givenid
.
If theentity
is NOT revision controlled, anempty list
is returned.- Parameters:
id
- theprimary key
of theentity
to retrieve the history for.- Returns:
- the
List
of historicrevisions
.
-
getRevisionHistoryMetadata
List<com.devonfw.module.basic.common.api.RevisionMetadata> getRevisionHistoryMetadata(Object id)
This method will get theList
ofRevisionMetadata
from therevision
-history of the entity with the givenid
.- Parameters:
id
- is theprimary key
of the entity for which the history-metadata is requested.- Returns:
- the requested
List
ofRevisionMetadata
.
-
load
ENTITY load(ID id, Number revision)
This method loads a historicrevision
of theRevisionedEntity
with the givenid
from the persistent store.
However if the givenrevision
isRevisionedEntity.LATEST_REVISION
thelatest revision will be loaded
.
ATTENTION:
You should not make assumptions about therevision
numbering of the underlying implementation. Please usegetRevisionHistory(Object)
orgetRevisionHistoryMetadata(Object)
to find revision numbers.- Parameters:
id
- is theprimary key
of the requestedentity
.revision
- is therevision
of the requested entity orRevisionedEntity.LATEST_REVISION
to get thelatest
revision. A specific revision has to be greater than0
.- Returns:
- the requested
entity
. - Throws:
RuntimeException
- if the requestedentity
could NOT be found.
-
delete
void delete(ENTITY entity)
The behavior of this method depends on the revision-control strategy of the implementation.
- In case of an audit-proof revision-history the deletion of the
latest revision
of an entity will only move it to the history while the deletion of ahistoric entity
is NOT permitted and will cause aPersistenceException
. - In case of an on-demand revision-history the deletion of the
latest revision
of an entity will either move it to the history or
entity
is ahistoric entity
the according historic- Specified by:
delete
in interfaceGenericDao<ID,ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>
- In case of an audit-proof revision-history the deletion of the
-
-