java.lang.Object
fr.paris.lutece.plugins.wiki.business.revision.RevisionHome

public class RevisionHome extends Object
This class provides instances management methods (create, find, ...) for Revision objects
  • Method Details

    • create

      public static Revision create(Revision revision)
      Create an instance of the revision class
      Parameters:
      revision - The instance of the Revision which contains the informations to store
      Returns:
      The instance of revision which has been created with its primary key.
    • findByPrimaryKey

      public static Revision findByPrimaryKey(int nKey)
      Returns an instance of a revision whose identifier is specified in parameter
      Parameters:
      nKey - The revision primary key
      Returns:
      an instance of Revision
    • getCurrentRevision

      public static Revision getCurrentRevision(int nEntityId)
      Load the current revision for an entity
      Parameters:
      nEntityId - The entity id
      Returns:
      The current revision
    • getRevisionHistory

      public static List<Revision> getRevisionHistory(int nEntityId)
      Get revision history for an entity
      Parameters:
      nEntityId - The entity id
      Returns:
      List of revisions ordered by revision number desc
    • getRevisionsByEntityIdsAndPeriod

      public static List<Revision> getRevisionsByEntityIdsAndPeriod(List<Integer> listEntityIds, Timestamp fromDate)
      Get revisions for multiple entities with optional date filter
      Parameters:
      listEntityIds - The list of entity ids
      fromDate - The minimum date (null for no filter)
      Returns:
      List of revisions ordered by date descending
    • getBatchByEntityAndRevisionNumber

      public static Map<String,Revision> getBatchByEntityAndRevisionNumber(List<int[]> listPairs)
      Batch load revisions by entity id and revision number pairs
      Parameters:
      listPairs - List of int arrays [entityId, revisionNumber]
      Returns:
      Map with key "entityId_revisionNumber" and value Revision