Class MediaOrderSQLQueryBuilder
- java.lang.Object
-
- org.silverpeas.components.gallery.dao.MediaOrderSQLQueryBuilder
-
- All Implemented Interfaces:
MediaOrderCriteriaProcessor
public class MediaOrderSQLQueryBuilder extends Object implements MediaOrderCriteriaProcessor
A dynamic builder of a SQL query.
-
-
Constructor Summary
Constructors Constructor Description MediaOrderSQLQueryBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendProcessing()Informs the processor the process is ended.List<Order>orderingResult(List<Order> orders)This method must be called after the order list is entirely loaded.MediaOrderCriteriaProcessorprocessComponentInstance(String componentInstanceId)Processes the criterion on the component instance identifier.MediaOrderCriteriaProcessorprocessIdentifiers(List<String> identifiers)Processes the criterion on the order identifiers.MediaOrderCriteriaProcessorprocessNbDaysAfterThatDeleteAnOrder(Date referenceDate, int nbDaysAfterThatDeleteAnOrder)Processes the criterion on the nb of days after that an order should be deleted.MediaOrderCriteriaProcessorprocessOrderer(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.voidstartProcessing()Informs the processor the start of the process.MediaOrderCriteriaProcessorthen()Informs the processor that there is a new criterion to process.
-
-
-
Method Detail
-
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
public MediaOrderCriteriaProcessor 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 processings.- Specified by:
thenin interfaceMediaOrderCriteriaProcessor- Returns:
- the processor itself.
-
processComponentInstance
public MediaOrderCriteriaProcessor processComponentInstance(String componentInstanceId)
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
public MediaOrderCriteriaProcessor processOrderer(String ordererId)
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 nb of days after that an order should be deleted.- Specified by:
processNbDaysAfterThatDeleteAnOrderin interfaceMediaOrderCriteriaProcessornbDaysAfterThatDeleteAnOrder- the nb of days after that an order should be deleted.- Returns:
- the processor itself.
-
processIdentifiers
public MediaOrderCriteriaProcessor processIdentifiers(List<String> identifiers)
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
public List<Order> orderingResult(List<Order> orders)
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
-
-