Interface GenericRevisionedDao<ID,​ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>

  • Type Parameters:
    ID - is the type of the primary 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 a GenericDao 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 the List of historic revisions of the entity with the given id.
      If the entity is NOT revision controlled, an empty list is returned.
      List<com.devonfw.module.basic.common.api.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.
      • Methods inherited from interface com.devonfw.module.jpa.dataaccess.api.feature.FeatureForceIncrementModificationCounter

        forceIncrementModificationCounter
    • Method Detail

      • getRevisionHistory

        List<Number> getRevisionHistory​(ID id)
        This method will get the List of historic revisions of the entity with the given id.
        If the entity is NOT revision controlled, an empty list is returned.
        Parameters:
        id - the primary key of the entity to retrieve the history for.
        Returns:
        the List of historic revisions.
      • getRevisionHistoryMetadata

        List<com.devonfw.module.basic.common.api.RevisionMetadata> getRevisionHistoryMetadata​(Object id)
        This method will get the List of RevisionMetadata from the revision-history of the entity with the given id.
        Parameters:
        id - is the primary key of the entity for which the history-metadata is requested.
        Returns:
        the requested List of RevisionMetadata.
      • load

        ENTITY load​(ID id,
                    Number revision)
        This method loads a historic revision of the RevisionedEntity with the given id from the persistent store.
        However if the given revision is RevisionedEntity.LATEST_REVISION the latest revision will be loaded.
        ATTENTION:
        You should not make assumptions about the revision numbering of the underlying implementation. Please use getRevisionHistory(Object) or getRevisionHistoryMetadata(Object) to find revision numbers.
        Parameters:
        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.
        Returns:
        the requested entity.
        Throws:
        RuntimeException - if the requested entity 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 a historic entity is NOT permitted and will cause a PersistenceException.
        • 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
        If the given entity is a historic entity the according historic
        Specified by:
        delete in interface GenericDao<ID,​ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>