Package org.silverpeas.components.suggestionbox.repository

# 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

  Modifier and Type
  Method
  Description
  `void`
  `endProcessing()`
  Informs the processor the process is ended.
  `SuggestionCriteriaProcessor`
  `processCreator(org.silverpeas.core.admin.user.model.User creator)`
  Processes the criterion on the creator of the suggestions.
  `SuggestionCriteriaProcessor`
  `processIdentifiers(List<String> identifiers)`
  Processes the criterion on the suggestion identifiers.
  `SuggestionCriteriaProcessor`
  `processJoinDataApply(List<SuggestionCriteria.JOIN_DATA_APPLY> joinDataApplies)`
  Processes the criterion on data joins of the suggestions matching the criteria.
  `SuggestionCriteriaProcessor`
  `processOrdering(List<SuggestionCriteria.QUERY_ORDER_BY> orderings)`
  Processes the criterion on orderings of the suggestions matching the criteria.
  `SuggestionCriteriaProcessor`
  `processPagination(org.silverpeas.core.admin.PaginationPage pagination)`
  Processes the criterion on the pagination to apply on the suggestions to return.
  `SuggestionCriteriaProcessor`
  `processStatus(List<org.silverpeas.core.contribution.ContributionStatus> status)`
  Processes the criterion on suggestion status.
  `SuggestionCriteriaProcessor`
  `processSuggestionBox(SuggestionBox box)`
  Processes the criterion on the suggestion box.
  `org.silverpeas.core.persistence.datasource.repository.QueryCriteria`
  `result()`
  Gets the result of the processing.
  `void`
  `startProcessing()`
  Informs the processor the start of the process.
  `SuggestionCriteriaProcessor`
  `then()`
  Informs the processor that there is a new criterion to process.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JPQLQueryBuilder

    public JPQLQueryBuilder(org.silverpeas.core.persistence.datasource.repository.jpa.NamedParameters parameters)

- ## Method Details

  - ### startProcessing

    public void startProcessing()
    Description copied from interface: `SuggestionCriteriaProcessor`
    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 interface `SuggestionCriteriaProcessor`

  - ### endProcessing

    public void endProcessing()
    Description copied from interface: `SuggestionCriteriaProcessor`
    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 interface `SuggestionCriteriaProcessor`

  - ### result

    public org.silverpeas.core.persistence.datasource.repository.QueryCriteria result()
    Description copied from interface: `SuggestionCriteriaProcessor`
    Gets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call of `SuggestionCriteriaProcessor.endProcessing()` method).
    Specified by:
      `result` in interface `SuggestionCriteriaProcessor`
    Returns:
      the processing result.

  - ### then

    public SuggestionCriteriaProcessor then()
    Description copied from interface: `SuggestionCriteriaProcessor`
    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 interface `SuggestionCriteriaProcessor`
    Returns:
      the processor itself.

  - ### processSuggestionBox

    public SuggestionCriteriaProcessor processSuggestionBox(SuggestionBox box)
    Description copied from interface: `SuggestionCriteriaProcessor`
    Processes the criterion on the suggestion box.
    Specified by:
      `processSuggestionBox` in interface `SuggestionCriteriaProcessor`
    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: `SuggestionCriteriaProcessor`
    Processes the criterion on the creator of the suggestions.
    Specified by:
      `processCreator` in interface `SuggestionCriteriaProcessor`
    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: `SuggestionCriteriaProcessor`
    Processes the criterion on suggestion status.
    Specified by:
      `processStatus` in interface `SuggestionCriteriaProcessor`
    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: `SuggestionCriteriaProcessor`
    Processes the criterion on data joins of the suggestions matching the criteria.
    Specified by:
      `processJoinDataApply` in interface `SuggestionCriteriaProcessor`
    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: `SuggestionCriteriaProcessor`
    Processes the criterion on orderings of the suggestions matching the criteria.
    Specified by:
      `processOrdering` in interface `SuggestionCriteriaProcessor`
    Parameters:
      `orderings` - the result orderings concerned by the criterion.
    Returns:
      the processor itself.

  - ### processIdentifiers

    public SuggestionCriteriaProcessor processIdentifiers(List<String> identifiers)
    Description copied from interface: `SuggestionCriteriaProcessor`
    Processes the criterion on the suggestion identifiers.
    Specified by:
      `processIdentifiers` in interface `SuggestionCriteriaProcessor`
    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: `SuggestionCriteriaProcessor`
    Processes the criterion on the pagination to apply on the suggestions to return.
    Specified by:
      `processPagination` in interface `SuggestionCriteriaProcessor`
    Parameters:
      `pagination` - a pagination definition.
    Returns:
      the processor itself.