Package org.camunda.bpm.engine.impl
Class AbstractQuery<T extends Query<?,?>,U>
java.lang.Object
org.camunda.bpm.engine.impl.db.ListQueryParameterObject
org.camunda.bpm.engine.impl.AbstractQuery<T,U>
- All Implemented Interfaces:
Serializable,Command<Object>,Query<T,U>
- Direct Known Subclasses:
AbstractVariableQueryImpl,ActivityStatisticsQueryImpl,AuthorizationQueryImpl,BatchQueryImpl,BatchStatisticsQueryImpl,CaseDefinitionQueryImpl,CaseSentryPartQueryImpl,CleanableHistoricBatchReportImpl,CleanableHistoricCaseInstanceReportImpl,CleanableHistoricDecisionInstanceReportImpl,CleanableHistoricProcessInstanceReportImpl,DecisionDefinitionQueryImpl,DecisionRequirementsDefinitionQueryImpl,DeploymentQueryImpl,DeploymentStatisticsQueryImpl,EventSubscriptionQueryImpl,ExternalTaskQueryImpl,FilterQueryImpl,GroupQueryImpl,HistoricActivityInstanceQueryImpl,HistoricActivityStatisticsQueryImpl,HistoricBatchQueryImpl,HistoricCaseActivityInstanceQueryImpl,HistoricCaseActivityStatisticsQueryImpl,HistoricDecisionInstanceQueryImpl,HistoricDecisionInstanceStatisticsQueryImpl,HistoricDetailQueryImpl,HistoricExternalTaskLogQueryImpl,HistoricJobLogQueryImpl,HistoricTaskInstanceQueryImpl,HistoricVariableInstanceQueryImpl,IncidentQueryImpl,JobDefinitionQueryImpl,JobQueryImpl,ProcessDefinitionQueryImpl,ProcessDefinitionStatisticsQueryImpl,SchemaLogQueryImpl,TaskQueryImpl,TenantQueryImpl,UserOperationLogQueryImpl,UserQueryImpl
public abstract class AbstractQuery<T extends Query<?,?>,U>
extends ListQueryParameterObject
implements Command<Object>, Query<T,U>, Serializable
Abstract superclass for all query types.
- Author:
- Joram Barrez
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandExecutorprotected booleanprotected AbstractQuery.ResultTypestatic final Stringstatic final Stringprotected Set<Validator<AbstractQuery<?,?>>> Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpression(String key, String expression) voidaddValidator(Validator<AbstractQuery<?, ?>> validator) 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).protected voidprotected voidlongcount()Executes the query and returns the number of resultsdesc()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).voidvoidprotected voidlongevaluateExpressionsAndExecuteCount(CommandContext commandContext) evaluateExpressionsAndExecuteDeploymentIdMappingsList(CommandContext commandContext) evaluateExpressionsAndExecuteIdsList(CommandContext commandContext) evaluateExpressionsAndExecuteList(CommandContext commandContext, Page page) execute(CommandContext commandContext) abstract longexecuteCount(CommandContext commandContext) executeDeploymentIdMappingsList(CommandContext commandContext) executeIdsList(CommandContext commandContext) executeList(CommandContext commandContext, Page page) Executes the actual query to retrieve the list of results.executeResult(AbstractQuery.ResultType resultType) executeSingleResult(CommandContext commandContext) protected Methodprotected booleanWhether or not the query has excluding conditions.list()Executes the query and get a list of entities as the result.listIds()listPage(int firstResult, int maxResults) Executes the query and get a list of entities as the result.protected voidmergeExpressions(AbstractQuery<?, ?> extendedQuery, AbstractQuery<?, ?> extendingQuery) protected voidmergeOrdering(AbstractQuery<?, ?> extendedQuery, AbstractQuery<?, ?> extendingQuery) orderBy(QueryOrderingProperty orderProperty) orderBy(QueryProperty property) voidremoveValidator(Validator<AbstractQuery<?, ?>> validator) setCommandExecutor(CommandExecutor commandExecutor) voidsetExpressions(Map<String, String> expressions) Executes the query and returns the resulting entity or null if no entity matches the query criteria.Executes the query.voidvalidate()voidvalidate(Validator<AbstractQuery<?, ?>> validator) Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, setParameter, setTenantCheck
-
Field Details
-
SORTORDER_ASC
- See Also:
-
SORTORDER_DESC
- See Also:
-
commandExecutor
-
resultType
-
expressions
-
validators
-
maxResultsLimitEnabled
protected boolean maxResultsLimitEnabled
-
-
Constructor Details
-
AbstractQuery
protected AbstractQuery() -
AbstractQuery
-
-
Method Details
-
setCommandExecutor
-
orderBy
-
orderBy
-
asc
Description copied from interface:QueryOrder 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
Description copied from interface:QueryOrder the results descending on the given property as defined in this class (needs to come after a call to one of the orderByXxxx methods). -
direction
-
checkQueryOk
protected void checkQueryOk() -
singleResult
Description copied from interface:QueryExecutes the query and returns the resulting entity or null if no entity matches the query criteria.- Specified by:
singleResultin interfaceQuery<T extends Query<?,?>, U>
-
list
Description copied from interface:QueryExecutes the query and get a list of entities as the result. -
listPage
Description copied from interface:QueryExecutes the query and get a list of entities as the result. -
executeResult
-
count
public long count()Description copied from interface:QueryExecutes the query and returns the number of results -
unlimitedList
Description copied from interface:QueryExecutes the query. No limitation checks are performed (e. g. query limit).- Specified by:
unlimitedListin interfaceQuery<T extends Query<?,?>, U> - Returns:
- a list of results
-
execute
-
evaluateExpressionsAndExecuteCount
-
executeCount
-
evaluateExpressionsAndExecuteList
-
hasExcludingConditions
protected boolean hasExcludingConditions()Whether or not the query has excluding conditions. If the query has excluding conditions, (e.g. task due date before and after are excluding), the SQL query is avoided and a default result is returned. The returned result is the same as if the SQL was executed and there were no entries.- Returns:
trueif the query does have excluding conditions,falseotherwise
-
executeList
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
-
getExpressions
-
setExpressions
-
addExpression
-
evaluateExpressions
protected void evaluateExpressions() -
getMethod
-
extend
-
mergeOrdering
-
mergeExpressions
protected void mergeExpressions(AbstractQuery<?, ?> extendedQuery, AbstractQuery<?, ?> extendingQuery) -
validate
public void validate() -
validate
-
addValidator
-
removeValidator
-
listIds
-
listDeploymentIdMappings
-
evaluateExpressionsAndExecuteIdsList
-
executeIdsList
-
evaluateExpressionsAndExecuteDeploymentIdMappingsList
public List<ImmutablePair<String,String>> evaluateExpressionsAndExecuteDeploymentIdMappingsList(CommandContext commandContext) -
executeDeploymentIdMappingsList
public List<ImmutablePair<String,String>> executeDeploymentIdMappingsList(CommandContext commandContext) -
checkMaxResultsLimit
protected void checkMaxResultsLimit() -
enableMaxResultsLimit
public void enableMaxResultsLimit() -
disableMaxResultsLimit
public void disableMaxResultsLimit()
-