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

  • Type Parameters:
    ID - is the type of the primary key of the managed entity.
    ENTITY - is the type of the managed entity.
    All Implemented Interfaces:
    com.devonfw.module.jpa.dataaccess.api.feature.FeatureForceIncrementModificationCounter<ENTITY>, GenericDao<ID,​ENTITY>, GenericRevisionedDao<ID,​ENTITY>
    Direct Known Subclasses:
    AbstractRevisionedDao

    public abstract class AbstractGenericRevisionedDao<ID,​ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>
    extends AbstractGenericDao<ID,​ENTITY>
    implements GenericRevisionedDao<ID,​ENTITY>
    This is the abstract base-implementation of a AbstractGenericDao using to manage the revision-control.
    Since:
    3.0.0
    • Constructor Detail

      • AbstractGenericRevisionedDao

        public AbstractGenericRevisionedDao()
        The constructor.
    • Method Detail

      • getAuditReader

        protected org.hibernate.envers.AuditReader getAuditReader()
        Returns:
        the auditReader
      • loadRevision

        protected ENTITY loadRevision​(Object id,
                                      Number revision)
        This method gets a historic revision of the entity with the given id.
        Parameters:
        id - is the ID of the requested entity.
        revision - is the revision
        Returns:
        the requested entity.
      • getRevisionHistory

        public List<Number> getRevisionHistory​(ID id)
        Description copied from interface: GenericRevisionedDao
        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.
        Specified by:
        getRevisionHistory in interface GenericRevisionedDao<ID,​ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>
        Parameters:
        id - the primary key of the entity to retrieve the history for.
        Returns:
        the List of historic revisions.
      • getRevisionHistoryMetadata

        public List<com.devonfw.module.basic.common.api.RevisionMetadata> getRevisionHistoryMetadata​(Object id)
        Description copied from interface: GenericRevisionedDao
        This method will get the List of RevisionMetadata from the revision-history of the entity with the given id.
        Specified by:
        getRevisionHistoryMetadata in interface GenericRevisionedDao<ID,​ENTITY extends com.devonfw.module.basic.common.api.entity.RevisionedPersistenceEntity<ID>>
        Parameters:
        id - is the primary key of the entity for which the history-metadata is requested.
        Returns:
        the requested List of RevisionMetadata.