Class JPQLQueryBuilder
- java.lang.Object
-
- org.silverpeas.core.notification.user.server.channel.silvermail.JPQLQueryBuilder
-
- All Implemented Interfaces:
SilvermailCriteriaProcessor
public class JPQLQueryBuilder extends Object implements SilvermailCriteriaProcessor
A dynamic builder of a JPQL query.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description JPQLQueryBuilder(NamedParameters parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endProcessing()
Informs the processor the process is ended.SilvermailCriteriaProcessor
processByIds(List<Long> ids)
Processes the criterion on the message identifiers.SilvermailCriteriaProcessor
processFolderId(long folderId)
Processes the criterion on the folder identifier.SilvermailCriteriaProcessor
processOrdering(List<SilvermailCriteria.QUERY_ORDER_BY> orderings)
Processes the criterion on orderings of the user notification matching the criteria.SilvermailCriteriaProcessor
processPagination(PaginationPage pagination)
Processes the criterion on the pagination to apply on the user notification to return.SilvermailCriteriaProcessor
processReadState(int readState)
Processes the criterion on the read state.SilvermailCriteriaProcessor
processUserId(long userId)
Processes the criterion on the user identifier.QueryCriteria
result()
Gets the result of the processing.void
startProcessing()
Informs the processor the start of the process.SilvermailCriteriaProcessor
then()
Informs the processor that there is a new criterion to process.
-
-
-
Constructor Detail
-
JPQLQueryBuilder
public JPQLQueryBuilder(NamedParameters parameters)
-
-
Method Detail
-
startProcessing
public void startProcessing()
Description copied from interface:SilvermailCriteriaProcessor
Informs 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:
startProcessing
in interfaceSilvermailCriteriaProcessor
-
endProcessing
public void endProcessing()
Description copied from interface:SilvermailCriteriaProcessor
Informs 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:
endProcessing
in interfaceSilvermailCriteriaProcessor
-
result
public QueryCriteria result()
Description copied from interface:SilvermailCriteriaProcessor
Gets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call ofSilvermailCriteriaProcessor.endProcessing()
method).- Specified by:
result
in interfaceSilvermailCriteriaProcessor
- Returns:
- the processing result.
-
then
public SilvermailCriteriaProcessor then()
Description copied from interface:SilvermailCriteriaProcessor
Informs 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:
then
in interfaceSilvermailCriteriaProcessor
- Returns:
- the processor itself.
-
processByIds
public SilvermailCriteriaProcessor processByIds(List<Long> ids)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on the message identifiers.- Specified by:
processByIds
in interfaceSilvermailCriteriaProcessor
- Parameters:
ids
- the identifier of messages.- Returns:
- the processor itself.
-
processUserId
public SilvermailCriteriaProcessor processUserId(long userId)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on the user identifier.- Specified by:
processUserId
in interfaceSilvermailCriteriaProcessor
- Parameters:
userId
- the identifier of a user.- Returns:
- the processor itself.
-
processFolderId
public SilvermailCriteriaProcessor processFolderId(long folderId)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on the folder identifier.- Specified by:
processFolderId
in interfaceSilvermailCriteriaProcessor
- Parameters:
folderId
- the identifier of a folder.- Returns:
- the processor itself.
-
processReadState
public SilvermailCriteriaProcessor processReadState(int readState)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on the read state.- Specified by:
processReadState
in interfaceSilvermailCriteriaProcessor
- Parameters:
readState
- the read state.- Returns:
- the processor itself.
-
processOrdering
public SilvermailCriteriaProcessor processOrdering(List<SilvermailCriteria.QUERY_ORDER_BY> orderings)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on orderings of the user notification matching the criteria.- Specified by:
processOrdering
in interfaceSilvermailCriteriaProcessor
- Parameters:
orderings
- the result orderings concerned by the criterion.- Returns:
- the processor itself.
-
processPagination
public SilvermailCriteriaProcessor processPagination(PaginationPage pagination)
Description copied from interface:SilvermailCriteriaProcessor
Processes the criterion on the pagination to apply on the user notification to return.- Specified by:
processPagination
in interfaceSilvermailCriteriaProcessor
- Parameters:
pagination
- a pagination definition.- Returns:
- the processor itself.
-
-