Class RevisionHome
java.lang.Object
fr.paris.lutece.plugins.wiki.business.revision.RevisionHome
This class provides instances management methods (create, find, ...) for Revision objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic RevisionCreate an instance of the revision classstatic RevisionfindByPrimaryKey(int nKey) Returns an instance of a revision whose identifier is specified in parametergetBatchByEntityAndRevisionNumber(List<int[]> listPairs) Batch load revisions by entity id and revision number pairsstatic RevisiongetCurrentRevision(int nEntityId) Load the current revision for an entitygetRevisionHistory(int nEntityId) Get revision history for an entitygetRevisionsByEntityIdsAndPeriod(List<Integer> listEntityIds, Timestamp fromDate) Get revisions for multiple entities with optional date filter
-
Method Details
-
create
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
Returns an instance of a revision whose identifier is specified in parameter- Parameters:
nKey- The revision primary key- Returns:
- an instance of Revision
-
getCurrentRevision
Load the current revision for an entity- Parameters:
nEntityId- The entity id- Returns:
- The current revision
-
getRevisionHistory
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 idsfromDate- The minimum date (null for no filter)- Returns:
- List of revisions ordered by date descending
-
getBatchByEntityAndRevisionNumber
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
-