Class MediaOrderSQLQueryBuilder
java.lang.Object
org.silverpeas.components.gallery.dao.MediaOrderSQLQueryBuilder
- All Implemented Interfaces:
MediaOrderCriteriaProcessor
A dynamic builder of a SQL query.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInforms the processor the process is ended.orderingResult(List<Order> orders) This method must be called after the order list is entirely loaded.processComponentInstance(String componentInstanceId) Processes the criterion on the component instance identifier.processIdentifiers(List<String> identifiers) Processes the criterion on the order identifiers.processNbDaysAfterThatDeleteAnOrder(Date referenceDate, int nbDaysAfterThatDeleteAnOrder) Processes the criterion on the number of days after that an order should be deleted.processOrderer(String ordererId) Processes the criterion on the orderer identifier of the orders.org.silverpeas.core.persistence.jdbc.sql.JdbcSqlQueryresult()Gets the result of the processing.voidInforms the processor the start of the process.then()Informs the processor that there is a new criterion to process.
-
Constructor Details
-
MediaOrderSQLQueryBuilder
public MediaOrderSQLQueryBuilder()
-
-
Method Details
-
startProcessing
public void startProcessing()Description copied from interface:MediaOrderCriteriaProcessorInforms 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 interfaceMediaOrderCriteriaProcessor
-
endProcessing
public void endProcessing()Description copied from interface:MediaOrderCriteriaProcessorInforms 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 interfaceMediaOrderCriteriaProcessor
-
result
public org.silverpeas.core.persistence.jdbc.sql.JdbcSqlQuery result()Description copied from interface:MediaOrderCriteriaProcessorGets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call ofMediaOrderCriteriaProcessor.endProcessing()method).- Specified by:
resultin interfaceMediaOrderCriteriaProcessor- Returns:
- the processing result.
-
then
Description copied from interface:MediaOrderCriteriaProcessorInforms the processor that there is a new criterion to process. This method must be used by the caller to chain the different criterion processing.- Specified by:
thenin interfaceMediaOrderCriteriaProcessor- Returns:
- the processor itself.
-
processComponentInstance
Description copied from interface:MediaOrderCriteriaProcessorProcesses the criterion on the component instance identifier.- Specified by:
processComponentInstancein interfaceMediaOrderCriteriaProcessor- Parameters:
componentInstanceId- the identifier of the component instance concerned by the criterion.- Returns:
- the processor itself.
-
processOrderer
Description copied from interface:MediaOrderCriteriaProcessorProcesses the criterion on the orderer identifier of the orders.- Specified by:
processOrdererin interfaceMediaOrderCriteriaProcessor- Parameters:
ordererId- the orderer user concerned by the criterion.- Returns:
- the processor itself.
-
processNbDaysAfterThatDeleteAnOrder
public MediaOrderCriteriaProcessor processNbDaysAfterThatDeleteAnOrder(Date referenceDate, int nbDaysAfterThatDeleteAnOrder) Description copied from interface:MediaOrderCriteriaProcessorProcesses the criterion on the number of days after that an order should be deleted.- Specified by:
processNbDaysAfterThatDeleteAnOrderin interfaceMediaOrderCriteriaProcessor- Parameters:
referenceDate- the date used as reference for number of days.nbDaysAfterThatDeleteAnOrder- the nb of days after that an order should be deleted.- Returns:
- the processor itself.
-
processIdentifiers
Description copied from interface:MediaOrderCriteriaProcessorProcesses the criterion on the order identifiers.- Specified by:
processIdentifiersin interfaceMediaOrderCriteriaProcessor- Parameters:
identifiers- the order identifiers concerned by the criterion.- Returns:
- the processor itself.
-
orderingResult
Description copied from interface:MediaOrderCriteriaProcessorThis method must be called after the order list is entirely loaded. If an ordering was specified and if it was not possible to perform it by SQL clauses, then a logical sort is performed.- Specified by:
orderingResultin interfaceMediaOrderCriteriaProcessor- Parameters:
orders- the list of orders to apply on the result.
-