Class SuggestedRevisionDAO
java.lang.Object
fr.paris.lutece.plugins.wiki.business.suggestedrevision.SuggestedRevisionDAO
- All Implemented Interfaces:
ISuggestedRevisionDAO
@ApplicationScoped
public class SuggestedRevisionDAO
extends Object
implements ISuggestedRevisionDAO
Data Access methods for SuggestedRevision objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountPendingByEntities(List<Integer> entityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a batch of entities in a single query.intcountPendingByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a single entity.voiddelete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Removes a suggestion by primary key.voidinsert(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Inserts a new suggestion.load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Loads a suggestion by primary key.selectAllPending(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns every pending suggestion, ordered by creation date desc.selectByAuthor(String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the suggestions submitted by the given author, ordered by creation date desc.selectPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the pending suggestion from a given author on a given entity, if any.voidupdateStatus(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates the status, reviewer and review comment of a suggestion.
-
Constructor Details
-
SuggestedRevisionDAO
public SuggestedRevisionDAO()
-
-
Method Details
-
insert
public void insert(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Inserts a new suggestion.- Specified by:
insertin interfaceISuggestedRevisionDAO- Parameters:
suggestion- the suggestion to persistplugin- the wiki plugin
-
updateStatus
public void updateStatus(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates the status, reviewer and review comment of a suggestion.- Specified by:
updateStatusin interfaceISuggestedRevisionDAO- Parameters:
suggestion- the suggestion to updateplugin- the wiki plugin
-
delete
public void delete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Removes a suggestion by primary key.- Specified by:
deletein interfaceISuggestedRevisionDAO- Parameters:
nKey- the suggestion idplugin- the wiki plugin
-
load
public Optional<SuggestedRevision> load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Loads a suggestion by primary key.- Specified by:
loadin interfaceISuggestedRevisionDAO- Parameters:
nKey- the suggestion idplugin- the wiki plugin- Returns:
- the suggestion if found
-
selectAllPending
public List<SuggestedRevision> selectAllPending(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns every pending suggestion, ordered by creation date desc.- Specified by:
selectAllPendingin interfaceISuggestedRevisionDAO- Parameters:
plugin- the wiki plugin- Returns:
- all pending suggestions
-
selectByAuthor
public List<SuggestedRevision> selectByAuthor(String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the suggestions submitted by the given author, ordered by creation date desc.- Specified by:
selectByAuthorin interfaceISuggestedRevisionDAO- Parameters:
strAuthorGuid- the proposer's user guidplugin- the wiki plugin- Returns:
- the suggestions submitted by this author
-
selectPendingByEntityAndAuthor
public Optional<SuggestedRevision> selectPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the pending suggestion from a given author on a given entity, if any.- Specified by:
selectPendingByEntityAndAuthorin interfaceISuggestedRevisionDAO- Parameters:
nEntityId- the wiki item idstrAuthorGuid- the proposer's user guidplugin- the wiki plugin- Returns:
- the pending suggestion if exists
-
countPendingByEntities
public Map<Integer,Integer> countPendingByEntities(List<Integer> entityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a batch of entities in a single query. Entities with no pending suggestion are absent from the result.- Specified by:
countPendingByEntitiesin interfaceISuggestedRevisionDAO- Parameters:
entityIds- the entity ids to count forplugin- the wiki plugin- Returns:
- a map of entity id to pending count
-
countPendingByEntity
public int countPendingByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a single entity.- Specified by:
countPendingByEntityin interfaceISuggestedRevisionDAO- Parameters:
nEntityId- the entity idplugin- the wiki plugin- Returns:
- the number of pending suggestions on this entity
-