Package org.activiti.engine.impl
Class AbstractQuery<T extends Query<?,?>,U>
- java.lang.Object
-
- org.activiti.engine.impl.db.ListQueryParameterObject
-
- org.activiti.engine.impl.AbstractQuery<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<java.lang.Object>, Query<T,U>, java.io.Serializable
Abstract superclass for all query types.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractQuery.NullHandlingOnOrder
-
Field Summary
Fields Modifier and Type Field Description protected CommandContextcommandContextprotected CommandExecutorcommandExecutorprotected java.lang.StringdatabaseTypeprotected AbstractQuery.NullHandlingOnOrdernullHandlingOnOrderprotected java.lang.StringorderByprotected QueryPropertyorderPropertyprotected org.activiti.engine.impl.AbstractQuery.ResultTyperesultTypestatic java.lang.StringSORTORDER_ASCstatic java.lang.StringSORTORDER_DESC-
Fields inherited from class org.activiti.engine.impl.db.ListQueryParameterObject
firstResult, maxResults, parameter
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractQuery()AbstractQuery(CommandContext commandContext)protectedAbstractQuery(CommandExecutor commandExecutor)AbstractQuery(ManagementService managementService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddOrder(java.lang.String column, java.lang.String sortOrder, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)Tasc()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 voidcheckQueryOk()longcount()Executes the query and returns the number of resultsTdesc()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).Tdirection(Direction direction)java.lang.Objectexecute(CommandContext commandContext)abstract longexecuteCount(CommandContext commandContext)abstract java.util.List<U>executeList(CommandContext commandContext, Page page)Executes the actual query to retrieve the list of results.UexecuteSingleResult(CommandContext commandContext)java.lang.StringgetDatabaseType()java.lang.StringgetOrderBy()java.lang.StringgetOrderByColumns()java.util.List<U>list()Executes the query and get a list of entities as the result.java.util.List<U>listPage(int firstResult, int maxResults)Executes the query and get a list of entities as the result.TorderBy(QueryProperty property)TorderBy(QueryProperty property, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)AbstractQuery<T,U>setCommandExecutor(CommandExecutor commandExecutor)voidsetDatabaseType(java.lang.String databaseType)UsingleResult()Executes the query and returns the resulting entity or null if no entity matches the query criteria.-
Methods inherited from class org.activiti.engine.impl.db.ListQueryParameterObject
getFirstResult, getFirstRow, getLastRow, getMaxResults, getParameter, setFirstResult, setMaxResults, setParameter
-
-
-
-
Field Detail
-
SORTORDER_ASC
public static final java.lang.String SORTORDER_ASC
- See Also:
- Constant Field Values
-
SORTORDER_DESC
public static final java.lang.String SORTORDER_DESC
- See Also:
- Constant Field Values
-
commandExecutor
protected transient CommandExecutor commandExecutor
-
commandContext
protected transient CommandContext commandContext
-
databaseType
protected java.lang.String databaseType
-
orderBy
protected java.lang.String orderBy
-
resultType
protected org.activiti.engine.impl.AbstractQuery.ResultType resultType
-
orderProperty
protected QueryProperty orderProperty
-
nullHandlingOnOrder
protected AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder
-
-
Constructor Detail
-
AbstractQuery
protected AbstractQuery()
-
AbstractQuery
protected AbstractQuery(CommandExecutor commandExecutor)
-
AbstractQuery
public AbstractQuery(CommandContext commandContext)
-
AbstractQuery
public AbstractQuery(ManagementService managementService)
-
-
Method Detail
-
setCommandExecutor
public AbstractQuery<T,U> setCommandExecutor(CommandExecutor commandExecutor)
-
orderBy
public T orderBy(QueryProperty property)
Description copied from interface:Query
-
orderBy
public T orderBy(QueryProperty property, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
-
asc
public T 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
public T 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).
-
checkQueryOk
protected void checkQueryOk()
-
singleResult
public U 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
public java.util.List<U> list()
Description copied from interface:QueryExecutes the query and get a list of entities as the result.
-
listPage
public java.util.List<U> listPage(int firstResult, int maxResults)
Description copied from interface:QueryExecutes the query and get a list of entities as the result.
-
count
public long count()
Description copied from interface:QueryExecutes the query and returns the number of results
-
execute
public java.lang.Object execute(CommandContext commandContext)
-
executeCount
public abstract long executeCount(CommandContext commandContext)
-
executeList
public abstract java.util.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(java.lang.String column, java.lang.String sortOrder, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
-
getOrderBy
public java.lang.String getOrderBy()
- Overrides:
getOrderByin classListQueryParameterObject
-
getOrderByColumns
public java.lang.String getOrderByColumns()
- Overrides:
getOrderByColumnsin classListQueryParameterObject
-
getDatabaseType
public java.lang.String getDatabaseType()
- Overrides:
getDatabaseTypein classListQueryParameterObject
-
setDatabaseType
public void setDatabaseType(java.lang.String databaseType)
- Overrides:
setDatabaseTypein classListQueryParameterObject
-
-