Package org.flowable.common.engine.api.query

# Interface Query<T extends Query<?,?>,U>

All Known Subinterfaces:
  `ActivityInstanceQuery`, `BaseJobQuery<U,T>`, `BatchPartQuery`, `BatchQuery`, `CaseDefinitionQuery`, `CaseInstanceQuery`, `ChannelDefinitionQuery`, `CmmnDeploymentQuery`, `DeadLetterJobQuery`, `DeploymentQuery`, `DmnDecisionQuery`, `DmnDeploymentQuery`, `DmnHistoricDecisionExecutionQuery`, `EventDefinitionQuery`, `EventDeploymentQuery`, `EventSubscriptionQuery`, `ExecutionQuery`, `ExternalWorkerJobQuery`, `GenericEventListenerInstanceQuery`, `HistoricActivityInstanceQuery`, `HistoricCaseInstanceQuery`, `HistoricDetailQuery`, `HistoricMilestoneInstanceQuery`, `HistoricPlanItemInstanceQuery`, `HistoricProcessInstanceQuery`, `HistoricTaskInstanceQuery`, `HistoricTaskLogEntryQuery`, `HistoricVariableInstanceQuery`, `HistoricVariableInstanceQuery`, `HistoryJobQuery`, `IntentEventListenerInstanceQuery`, `JobQuery`, `MilestoneInstanceQuery`, `ModelQuery`, `PlanItemInstanceQuery`, `ProcessDefinitionQuery`, `ProcessInstanceQuery`, `SignalEventListenerInstanceQuery`, `SuspendedJobQuery`, `TaskInfoQuery<T,V>`, `TaskQuery`, `TimerJobQuery`, `UserEventListenerInstanceQuery`, `VariableInstanceQuery`, `VariableInstanceQuery`

public interface Query<T extends Query<?,?>,U>
Describes basic methods for querying.

Author:
  Frederik Heremans

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static enum`
  `Query.NullHandlingOnOrder`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `asc()`
  Order the results ascending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).
  `long`
  `count()`
  Executes the query and returns the number of results
  `T`
  `desc()`
  Order the results descending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).
  `List<U>`
  `list()`
  Executes the query and get a list of entities as the result.
  `List<U>`
  `listPage(int firstResult, int maxResults)`
  Executes the query and get a list of entities as the result.
  `T`
  `orderBy(QueryProperty property)`
  `T`
  `orderBy(QueryProperty property, Query.NullHandlingOnOrder nullHandlingOnOrder)`
  `U`
  `singleResult()`
  Executes the query and returns the resulting entity or null if no entity matches the query criteria.

- ## Method Details

  - ### asc

    T asc()
    Order the results ascending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).

  - ### desc

    T desc()
    Order the results descending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods).

  - ### orderBy

    T orderBy(QueryProperty property)

  - ### orderBy

    T orderBy(QueryProperty property, Query.NullHandlingOnOrder nullHandlingOnOrder)

  - ### count

    long count()
    Executes the query and returns the number of results

  - ### singleResult

    U singleResult()
    Executes the query and returns the resulting entity or null if no entity matches the query criteria.
    Throws:
      `FlowableException` - when the query results in more than one entities.

  - ### list

    List<U> list()
    Executes the query and get a list of entities as the result.

  - ### listPage

    List<U> listPage(int firstResult, int maxResults)
    Executes the query and get a list of entities as the result.