Class JPQLQueryBuilder
- java.lang.Object
-
- org.silverpeas.components.suggestionbox.repository.JPQLQueryBuilder
-
- All Implemented Interfaces:
SuggestionCriteriaProcessor
public class JPQLQueryBuilder extends Object implements SuggestionCriteriaProcessor
A dynamic builder of a JPQL query.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description JPQLQueryBuilder(org.silverpeas.core.persistence.datasource.repository.jpa.NamedParameters parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendProcessing()Informs the processor the process is ended.SuggestionCriteriaProcessorprocessCreator(org.silverpeas.core.admin.user.model.User creator)Processes the criterion on the creator of the suggestions.SuggestionCriteriaProcessorprocessIdentifiers(List<String> identifiers)Processes the criterion on the suggestion identifiers.SuggestionCriteriaProcessorprocessJoinDataApply(List<SuggestionCriteria.JOIN_DATA_APPLY> joinDataApplies)Processes the criterion on data joins of the suggestions matching the criteria.SuggestionCriteriaProcessorprocessOrdering(List<SuggestionCriteria.QUERY_ORDER_BY> orderings)Processes the criterion on orderings of the suggestions matching the criteria.SuggestionCriteriaProcessorprocessPagination(org.silverpeas.core.admin.PaginationPage pagination)Processes the criterion on the pagination to apply on the suggestions to return.SuggestionCriteriaProcessorprocessStatus(List<org.silverpeas.core.contribution.ContributionStatus> status)Processes the criterion on suggestion status.SuggestionCriteriaProcessorprocessSuggestionBox(SuggestionBox box)Processes the criterion on the suggestion box.org.silverpeas.core.persistence.datasource.repository.QueryCriteriaresult()Gets the result of the processing.voidstartProcessing()Informs the processor the start of the process.SuggestionCriteriaProcessorthen()Informs the processor that there is a new criterion to process.
-
-
-
Method Detail
-
startProcessing
public void startProcessing()
Description copied from interface:SuggestionCriteriaProcessorInforms the processor the start of the process. The processor use this method to allocate all the resources required by the processing here. It uses it to initialize the processor state machine.- Specified by:
startProcessingin interfaceSuggestionCriteriaProcessor
-
endProcessing
public void endProcessing()
Description copied from interface:SuggestionCriteriaProcessorInforms the processor the process is ended. The processor use this method to deallocate all the resources that were used during the processing. It uses it to tear down the processor state machine or to finalize some treatments. The processing has to stop once this method is called. Hence, the call of process methods should result to nothing or to an exception.- Specified by:
endProcessingin interfaceSuggestionCriteriaProcessor
-
result
public org.silverpeas.core.persistence.datasource.repository.QueryCriteria result()
Description copied from interface:SuggestionCriteriaProcessorGets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call ofSuggestionCriteriaProcessor.endProcessing()method).- Specified by:
resultin interfaceSuggestionCriteriaProcessor- Returns:
- the processing result.
-
then
public SuggestionCriteriaProcessor then()
Description copied from interface:SuggestionCriteriaProcessorInforms the processor that there is a new criterion to process. This method must be used by the caller to chain the different criterion processings.- Specified by:
thenin interfaceSuggestionCriteriaProcessor- Returns:
- the processor itself.
-
processSuggestionBox
public SuggestionCriteriaProcessor processSuggestionBox(SuggestionBox box)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on the suggestion box.- Specified by:
processSuggestionBoxin interfaceSuggestionCriteriaProcessor- Parameters:
box- the suggestion box concerned by the criterion.- Returns:
- the processor itself.
-
processCreator
public SuggestionCriteriaProcessor processCreator(org.silverpeas.core.admin.user.model.User creator)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on the creator of the suggestions.- Specified by:
processCreatorin interfaceSuggestionCriteriaProcessor- Parameters:
creator- the user concerned by the criterion.- Returns:
- the processor itself.
-
processStatus
public SuggestionCriteriaProcessor processStatus(List<org.silverpeas.core.contribution.ContributionStatus> status)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on suggestion status.- Specified by:
processStatusin interfaceSuggestionCriteriaProcessor- Parameters:
status- the suggestion status concerned by the criterion.- Returns:
- the processor itself.
-
processJoinDataApply
public SuggestionCriteriaProcessor processJoinDataApply(List<SuggestionCriteria.JOIN_DATA_APPLY> joinDataApplies)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on data joins of the suggestions matching the criteria.- Specified by:
processJoinDataApplyin interfaceSuggestionCriteriaProcessor- Parameters:
joinDataApplies- the result data joins concerned by the criterion.- Returns:
- the processor itself.
-
processOrdering
public SuggestionCriteriaProcessor processOrdering(List<SuggestionCriteria.QUERY_ORDER_BY> orderings)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on orderings of the suggestions matching the criteria.- Specified by:
processOrderingin interfaceSuggestionCriteriaProcessor- Parameters:
orderings- the result orderings concerned by the criterion.- Returns:
- the processor itself.
-
processIdentifiers
public SuggestionCriteriaProcessor processIdentifiers(List<String> identifiers)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on the suggestion identifiers.- Specified by:
processIdentifiersin interfaceSuggestionCriteriaProcessor- Parameters:
identifiers- the suggestion identifiers concerned by the criterion.- Returns:
- the processor itself.
-
processPagination
public SuggestionCriteriaProcessor processPagination(org.silverpeas.core.admin.PaginationPage pagination)
Description copied from interface:SuggestionCriteriaProcessorProcesses the criterion on the pagination to apply on the suggestions to return.- Specified by:
processPaginationin interfaceSuggestionCriteriaProcessor- Parameters:
pagination- a pagination definition.- Returns:
- the processor itself.
-
-