Interface IRevisionDAO
- All Known Implementing Classes:
RevisionDAO
public interface IRevisionDAO
IRevisionDAO Interface
-
Method Summary
Modifier and TypeMethodDescriptionintgetNextRevisionNumber(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the next revision number for an entityvoidInsert a new record in the table.load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data from the tableloadBatchByEntityAndRevisionNumber(List<int[]> listPairs, fr.paris.lutece.portal.service.plugin.Plugin plugin) Batch load revisions by entity id and revision number pairsloadCurrentRevision(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the current revision for an entityselectRevisionsByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load all revisions for an entity ordered by revision number descendingselectRevisionsByEntityIdsAndPeriod(List<Integer> listEntityIds, Timestamp fromDate, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load revisions for multiple entities with optional date filtervoidsetAllNotCurrent(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Set all revisions as not current for an entity
-
Method Details
-
insert
Insert a new record in the table.- Parameters:
revision- instance of the Revision object to insertplugin- the Plugin
-
load
Load the data from the table- Parameters:
nKey- The identifier of the revisionplugin- the Plugin- Returns:
- Optional containing the revision if found, empty otherwise
-
loadCurrentRevision
Load the current revision for an entity- Parameters:
nEntityId- The entity idplugin- 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 idplugin- 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 idplugin- 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 idplugin- 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 idsfromDate- 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
-