Interface IRevisionDAO

All Known Implementing Classes:
RevisionDAO

public interface IRevisionDAO
IRevisionDAO Interface
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getNextRevisionNumber(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the next revision number for an entity
    void
    insert(Revision revision, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Insert a new record in the table.
    load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the data from the table
    loadBatchByEntityAndRevisionNumber(List<int[]> listPairs, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Batch load revisions by entity id and revision number pairs
    loadCurrentRevision(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the current revision for an entity
    selectRevisionsByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load all revisions for an entity ordered by revision number descending
    selectRevisionsByEntityIdsAndPeriod(List<Integer> listEntityIds, Timestamp fromDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load revisions for multiple entities with optional date filter
    void
    setAllNotCurrent(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Set all revisions as not current for an entity
  • Method Details

    • insert

      void insert(Revision revision, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Parameters:
      revision - instance of the Revision object to insert
      plugin - the Plugin
    • load

      Optional<Revision> load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      Parameters:
      nKey - The identifier of the revision
      plugin - the Plugin
      Returns:
      Optional containing the revision if found, empty otherwise
    • loadCurrentRevision

      Revision loadCurrentRevision(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the current revision for an entity
      Parameters:
      nEntityId - The entity id
      plugin - the Plugin
      Returns:
      The current revision
    • selectRevisionsByEntity

      List<Revision> selectRevisionsByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load all revisions for an entity ordered by revision number descending
      Parameters:
      nEntityId - The entity id
      plugin - the Plugin
      Returns:
      The list of revisions (revision history)
    • getNextRevisionNumber

      int getNextRevisionNumber(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the next revision number for an entity
      Parameters:
      nEntityId - The entity id
      plugin - the Plugin
      Returns:
      The next revision number
    • setAllNotCurrent

      void setAllNotCurrent(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Set all revisions as not current for an entity
      Parameters:
      nEntityId - The entity id
      plugin - the Plugin
    • selectRevisionsByEntityIdsAndPeriod

      List<Revision> selectRevisionsByEntityIdsAndPeriod(List<Integer> listEntityIds, Timestamp fromDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load revisions for multiple entities with optional date filter
      Parameters:
      listEntityIds - The list of entity ids
      fromDate - The minimum date (null for no filter)
      plugin - the Plugin
      Returns:
      The list of revisions ordered by date descending
    • loadBatchByEntityAndRevisionNumber

      Map<String,Revision> loadBatchByEntityAndRevisionNumber(List<int[]> listPairs, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Batch load revisions by entity id and revision number pairs
      Parameters:
      listPairs - List of int arrays [entityId, revisionNumber]
      plugin - the Plugin
      Returns:
      Map with key "entityId_revisionNumber" and value Revision