Class AbstractQuery<T extends Query<?,?>,U>

java.lang.Object
org.activiti.engine.impl.db.ListQueryParameterObject
org.activiti.engine.impl.AbstractQuery<T,U>
All Implemented Interfaces:
Serializable, Command<Object>, Query<T,U>
Direct Known Subclasses:
AbstractVariableQueryImpl, DeadLetterJobQueryImpl, DeploymentQueryImpl, EventSubscriptionQueryImpl, HistoricActivityInstanceQueryImpl, HistoricDetailQueryImpl, HistoricVariableInstanceQueryImpl, JobQueryImpl, ModelQueryImpl, ProcessDefinitionQueryImpl, SuspendedJobQueryImpl, TimerJobQueryImpl

public abstract class AbstractQuery<T extends Query<?,?>,U> extends ListQueryParameterObject implements Command<Object>, Query<T,U>, Serializable
Abstract superclass for all query types.
See Also:
  • Field Details

  • Constructor Details

    • AbstractQuery

      protected AbstractQuery()
    • AbstractQuery

      protected AbstractQuery(CommandExecutor commandExecutor)
    • AbstractQuery

      public AbstractQuery(CommandContext commandContext)
    • AbstractQuery

      public AbstractQuery(ManagementService managementService)
  • Method Details

    • setCommandExecutor

      public AbstractQuery<T,U> setCommandExecutor(CommandExecutor commandExecutor)
    • orderBy

      public T orderBy(QueryProperty property)
      Description copied from interface: Query
      Order the results by the given QueryProperty (needs to be followed by Query.asc() or Query.desc())
      Specified by:
      orderBy in interface Query<T extends Query<?,?>,U>
      Parameters:
      property - the QueryProperty to be used to order the results
      Returns:
      itself
    • orderBy

      public T orderBy(QueryProperty property, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
    • asc

      public T asc()
      Description copied from interface: Query
      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).
      Specified by:
      asc in interface Query<T extends Query<?,?>,U>
    • desc

      public T desc()
      Description copied from interface: Query
      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).
      Specified by:
      desc in interface Query<T extends Query<?,?>,U>
    • direction

      public T direction(Direction direction)
    • checkQueryOk

      protected void checkQueryOk()
    • singleResult

      public U singleResult()
      Description copied from interface: Query
      Executes the query and returns the resulting entity or null if no entity matches the query criteria.
      Specified by:
      singleResult in interface Query<T extends Query<?,?>,U>
    • list

      public List<U> list()
      Description copied from interface: Query
      Executes the query and get a list of entities as the result.
      Specified by:
      list in interface Query<T extends Query<?,?>,U>
    • listPage

      public List<U> listPage(int firstResult, int maxResults)
      Description copied from interface: Query
      Executes the query and get a list of entities as the result.
      Specified by:
      listPage in interface Query<T extends Query<?,?>,U>
    • count

      public long count()
      Description copied from interface: Query
      Executes the query and returns the number of results
      Specified by:
      count in interface Query<T extends Query<?,?>,U>
    • execute

      public Object execute(CommandContext commandContext)
      Specified by:
      execute in interface Command<T extends Query<?,?>>
    • executeCount

      public abstract long executeCount(CommandContext commandContext)
    • executeList

      public abstract List<U> executeList(CommandContext commandContext, Page page)
      Executes the actual query to retrieve the list of results.
      Parameters:
      page - used if the results must be paged. If null, no paging will be applied.
    • executeSingleResult

      public U executeSingleResult(CommandContext commandContext)
    • addOrder

      protected void addOrder(String column, String sortOrder, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
    • getOrderBy

      public String getOrderBy()
      Overrides:
      getOrderBy in class ListQueryParameterObject
    • getOrderByColumns

      public String getOrderByColumns()
      Overrides:
      getOrderByColumns in class ListQueryParameterObject
    • getDatabaseType

      public String getDatabaseType()
      Overrides:
      getDatabaseType in class ListQueryParameterObject
    • setDatabaseType

      public void setDatabaseType(String databaseType)
      Overrides:
      setDatabaseType in class ListQueryParameterObject