public abstract class AbstractQuery<T extends Query<?,?>,U> extends ListQueryParameterObject implements Command<Object>, Query<T,U>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractQuery.NullHandlingOnOrder |
Modifier and Type | Field and Description |
---|---|
protected CommandContext |
commandContext |
protected CommandExecutor |
commandExecutor |
protected String |
databaseType |
protected AbstractQuery.NullHandlingOnOrder |
nullHandlingOnOrder |
protected String |
orderBy |
protected QueryProperty |
orderProperty |
protected org.activiti.engine.impl.AbstractQuery.ResultType |
resultType |
static String |
SORTORDER_ASC |
static String |
SORTORDER_DESC |
firstResult, maxResults, parameter
Modifier | Constructor and Description |
---|---|
protected |
AbstractQuery() |
|
AbstractQuery(CommandContext commandContext) |
protected |
AbstractQuery(CommandExecutor commandExecutor) |
|
AbstractQuery(ManagementService managementService) |
Modifier and Type | Method and Description |
---|---|
protected void |
addOrder(String column,
String sortOrder,
AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder) |
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).
|
protected void |
checkQueryOk() |
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).
|
T |
direction(Direction direction) |
Object |
execute(CommandContext commandContext) |
abstract long |
executeCount(CommandContext commandContext) |
abstract List<U> |
executeList(CommandContext commandContext,
Page page)
Executes the actual query to retrieve the list of results.
|
U |
executeSingleResult(CommandContext commandContext) |
String |
getDatabaseType() |
String |
getOrderBy() |
String |
getOrderByColumns() |
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,
AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder) |
AbstractQuery<T,U> |
setCommandExecutor(CommandExecutor commandExecutor) |
void |
setDatabaseType(String databaseType) |
U |
singleResult()
Executes the query and returns the resulting entity or null if no
entity matches the query criteria.
|
getFirstResult, getFirstRow, getLastRow, getMaxResults, getParameter, setFirstResult, setMaxResults, setParameter
public static final String SORTORDER_ASC
public static final String SORTORDER_DESC
protected transient CommandExecutor commandExecutor
protected transient CommandContext commandContext
protected String databaseType
protected String orderBy
protected org.activiti.engine.impl.AbstractQuery.ResultType resultType
protected QueryProperty orderProperty
protected AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder
protected AbstractQuery()
protected AbstractQuery(CommandExecutor commandExecutor)
public AbstractQuery(CommandContext commandContext)
public AbstractQuery(ManagementService managementService)
public AbstractQuery<T,U> setCommandExecutor(CommandExecutor commandExecutor)
public T orderBy(QueryProperty property)
public T orderBy(QueryProperty property, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
public T asc()
Query
public T desc()
Query
protected void checkQueryOk()
public U singleResult()
Query
singleResult
in interface Query<T extends Query<?,?>,U>
public List<U> list()
Query
public List<U> listPage(int firstResult, int maxResults)
Query
public long count()
Query
public Object execute(CommandContext commandContext)
public abstract long executeCount(CommandContext commandContext)
public abstract List<U> executeList(CommandContext commandContext, Page page)
page
- used if the results must be paged. If null, no paging will be applied.public U executeSingleResult(CommandContext commandContext)
protected void addOrder(String column, String sortOrder, AbstractQuery.NullHandlingOnOrder nullHandlingOnOrder)
public String getOrderBy()
getOrderBy
in class ListQueryParameterObject
public String getOrderByColumns()
getOrderByColumns
in class ListQueryParameterObject
public String getDatabaseType()
getDatabaseType
in class ListQueryParameterObject
public void setDatabaseType(String databaseType)
setDatabaseType
in class ListQueryParameterObject
Copyright © 2016 Alfresco. All rights reserved.