T
- candidate type for this querypublic interface JDOQLTypedQuery<T> extends Serializable, Closeable
Modifier and Type | Field and Description |
---|---|
static String |
QUERY_CLASS_PREFIX |
Modifier and Type | Method and Description |
---|---|
void |
cancel(Thread thread)
Method to cancel an executing query in the specified thread.
|
void |
cancelAll()
Method to cancel any executing queries.
|
PersistableExpression<T> |
candidate()
Method to return an expression for the candidate of the query.
|
CharacterExpression |
characterParameter(String name)
Method to return a character parameter for the query.
|
void |
close(Object result)
Method to close the specified query result.
|
void |
closeAll()
Method to close all query results from this query.
|
CollectionExpression<?,?> |
collectionParameter(String name)
Method to return a collection parameter for the query.
|
default <E> CollectionExpression<Collection<E>,E> |
collectionParameter(String name,
Class<E> elementType)
Method to return a collection parameter for the query.
|
JDOQLTypedQuery<T> |
datastoreReadTimeoutMillis(Integer interval)
Set the datastore read timeout (millis).
|
JDOQLTypedQuery<T> |
datastoreWriteTimeoutMillis(Integer interval)
Set the datastore write timeout (millis).
|
DateExpression |
dateParameter(String name)
Method to return a date parameter for the query.
|
DateTimeExpression |
datetimeParameter(String name)
Method to return a datetime parameter for the query.
|
long |
deletePersistentAll()
Method to execute the query deleting the affected instances.
|
JDOQLTypedQuery<T> |
excludeSubclasses()
Method to remove subclasses (of the candidate) from the query
|
List<T> |
executeList()
Method to execute the query where there are (potentially) multiple rows and we are returning the candidate type.
|
List<Object> |
executeResultList()
Method to execute the query where there are (potentially) multiple rows and we have a result defined but no result class.
|
<R> List<R> |
executeResultList(Class<R> resultCls)
Method to execute the query where there are (potentially) multiple rows and we are returning either the result type.
|
Object |
executeResultUnique()
Method to execute the query where there is a single row and we have a result defined but no result class.
|
<R> R |
executeResultUnique(Class<R> resultCls)
Method to execute the query where there is a single row and we are returning either the result type.
|
T |
executeUnique()
Method to execute the query where there is a single row and we are returning the candidate type.
|
JDOQLTypedQuery<T> |
extension(String key,
Object value)
Specify an extension for this query.
|
JDOQLTypedQuery<T> |
extensions(Map values)
Specify a map of extensions for this query.
|
JDOQLTypedQuery<T> |
filter(BooleanExpression expr)
Method to set the filter of the query.
|
Integer |
getDatastoreReadTimeoutMillis()
Get the effective timeout setting for read operations.
|
Integer |
getDatastoreWriteTimeoutMillis()
Get the effective timeout setting for write operations.
|
FetchPlan |
getFetchPlan()
Accessor for the FetchPlan for this query
|
boolean |
getIgnoreCache()
Get the ignoreCache option setting.
|
PersistenceManager |
getPersistenceManager()
Accessor for the PersistenceManager for this query
|
Boolean |
getSerializeRead()
Return the current value of the serializeRead property.
|
JDOQLTypedQuery<T> |
groupBy(Expression<?>... exprs)
Method to set the grouping(s) for the query.
|
JDOQLTypedQuery<T> |
having(Expression<?> expr)
Method to set the having clause of the query.
|
<V> IfThenElseExpression<V> |
ifThen(BooleanExpression cond,
V thenValue)
Method to return an "IF (...) ...
|
<V> IfThenElseExpression<V> |
ifThen(Class<V> type,
BooleanExpression cond,
Expression<V> thenValueExpr)
Method to return an "IF (...) ...
|
<V> IfThenElseExpression<V> |
ifThenElse(BooleanExpression cond,
Expression<V> thenValueExpr,
V elseValue)
Method to return an "IF (...) ...
|
<V> IfThenElseExpression<V> |
ifThenElse(BooleanExpression cond,
V thenValue,
Expression<V> elseValueExpr)
Method to return an "IF (...) ...
|
<V> IfThenElseExpression<V> |
ifThenElse(BooleanExpression cond,
V thenValue,
V elseValue)
Method to return an "IF (...) ...
|
<V> IfThenElseExpression<V> |
ifThenElse(Class<V> type,
BooleanExpression cond,
Expression<V> thenValueExpr,
Expression<V> elseValueExpr)
Method to return an "IF (...) ...
|
JDOQLTypedQuery<T> |
ignoreCache(boolean flag)
Set whether we to ignore the cache with this query.
|
JDOQLTypedQuery<T> |
includeSubclasses()
Method to include subclasses (of the candidate) to the query
|
boolean |
isUnmodifiable()
The unmodifiable flag, when set, disallows further modification of the query,
except for specifying the range, result class, and ignoreCache option.
|
ListExpression<?,?> |
listParameter(String name)
Method to return a list parameter for the query.
|
default <E> ListExpression<List<E>,E> |
listParameter(String name,
Class<E> elementType)
Method to return a list parameter for the query.
|
MapExpression<?,?,?> |
mapParameter(String name)
Method to return a map parameter for the query.
|
default <K,V> MapExpression<Map<K,V>,K,V> |
mapParameter(String name,
Class<K> keyType,
Class<V> valueType)
Method to return a map parameter for the query.
|
NumericExpression<?> |
numericParameter(String name)
Method to return a numeric parameter for the query.
|
default <N> NumericExpression<N> |
numericParameter(String name,
Class<N> type)
Method to return a numeric parameter for the query.
|
JDOQLTypedQuery<T> |
orderBy(OrderExpression<?>... orderExprs)
Method to set the ordering of the query.
|
<P> Expression<P> |
parameter(String name,
Class<P> type)
Method to return a parameter for the query.
|
JDOQLTypedQuery<T> |
range(Expression<?> paramLowerInclExpr,
Expression<?> paramUpperExclExpr)
Method to set the range of any required results, using parameters (expressions).
|
JDOQLTypedQuery<T> |
range(long lowerIncl,
long upperExcl)
Method to set the range of any required results, using long values.
|
JDOQLTypedQuery<T> |
range(NumericExpression<?> lowerInclExpr,
NumericExpression<?> upperExclExpr)
Method to set the range of any required results, using expressions.
|
JDOQLTypedQuery<T> |
result(boolean distinct,
Expression<?>... exprs)
Method to set the result of the query.
|
JDOQLTypedQuery<T> |
saveAsNamedQuery(String name)
Save the query, as it is currently defined, as a named query under the specified name.
|
JDOQLTypedQuery<T> |
serializeRead(Boolean serialize)
Set whether we to lock all objects read by this query.
|
JDOQLTypedQuery<T> |
setCandidates(Collection<T> candidates)
Method to set the candidates to use over which we are querying.
|
JDOQLTypedQuery<T> |
setParameter(Expression<?> paramExpr,
Object value)
Method to set a parameter value for the specified (parameter) expression when executing the query.
|
JDOQLTypedQuery<T> |
setParameter(String paramName,
Object value)
Method to set the value for a named parameter for use when executing the query.
|
JDOQLTypedQuery<T> |
setParameters(Map<String,?> namedParamMap)
Method to set the named parameters on this query prior to execution.
|
StringExpression |
stringParameter(String name)
Method to return a string parameter for the query.
|
<S> JDOQLTypedSubquery<S> |
subquery(Class<S> candidate,
String candidateAlias)
Method to return a subquery for use in this query.
|
<E> JDOQLTypedSubquery<E> |
subquery(CollectionExpression<Collection<E>,E> candidateCollection,
Class<E> candidate,
String candidateAlias)
Method to return a correlated subquery for use in this query.
|
JDOQLTypedSubquery<T> |
subquery(String candidateAlias)
Method to return a subquery for use in this query using the same candidate class as this query.
|
TimeExpression |
timeParameter(String name)
Method to return a time parameter for the query.
|
String |
toString()
Method to return the equivalent String form of this query (if applicable for the query language).
|
JDOQLTypedQuery<T> |
unmodifiable()
Set to make this query unmodifiable hereafter.
|
<V> Expression<V> |
variable(String name,
Class<V> type)
Method to return a variable for this query.
|
static final String QUERY_CLASS_PREFIX
PersistableExpression<T> candidate()
<P> Expression<P> parameter(String name, Class<P> type)
P
- type for the parametername
- Name of the parametertype
- Java type of the parameterStringExpression stringParameter(String name)
name
- Name of the parameterCharacterExpression characterParameter(String name)
name
- Name of the parameterNumericExpression<?> numericParameter(String name)
name
- Name of the parameterdefault <N> NumericExpression<N> numericParameter(String name, Class<N> type)
N
- Type for the numeric parametername
- Name of the parametertype
- Type of the numeric parameterDateExpression dateParameter(String name)
name
- Name of the parameterTimeExpression timeParameter(String name)
name
- Name of the parameterDateTimeExpression datetimeParameter(String name)
name
- Name of the parameterCollectionExpression<?,?> collectionParameter(String name)
name
- Name of the parameterdefault <E> CollectionExpression<Collection<E>,E> collectionParameter(String name, Class<E> elementType)
E
- Element type for the collection parametername
- Name of the parameterelementType
- Element type of the collection parameterMapExpression<?,?,?> mapParameter(String name)
name
- Name of the parameterdefault <K,V> MapExpression<Map<K,V>,K,V> mapParameter(String name, Class<K> keyType, Class<V> valueType)
K
- Key type for the map parameterV
- Value type for the map parametername
- Name of the parameterkeyType
- Key type of the map parametervalueType
- Value type of the map parameterListExpression<?,?> listParameter(String name)
name
- Name of the parameterdefault <E> ListExpression<List<E>,E> listParameter(String name, Class<E> elementType)
E
- Element type for the list parametername
- Name of the parameterelementType
- Element type of the list parameter<V> Expression<V> variable(String name, Class<V> type)
V
- type for the variablename
- Name of the variabletype
- Type of the variableJDOQLTypedQuery<T> setCandidates(Collection<T> candidates)
candidates
- The candidatesJDOQLTypedQuery<T> excludeSubclasses()
JDOQLTypedQuery<T> includeSubclasses()
JDOQLTypedQuery<T> filter(BooleanExpression expr)
expr
- Filter expression<V> IfThenElseExpression<V> ifThenElse(Class<V> type, BooleanExpression cond, Expression<V> thenValueExpr, Expression<V> elseValueExpr)
V
- type for the IfThenElseExpressiontype
- The type returned by the IfElse.cond
- The if conditionthenValueExpr
- Expression for value to return when the if expression is metelseValueExpr
- Expression for value to return when the if expression is not met<V> IfThenElseExpression<V> ifThenElse(BooleanExpression cond, V thenValue, Expression<V> elseValueExpr)
V
- type for the IfThenElseExpressioncond
- The if conditionthenValue
- Value to return when the if expression is metelseValueExpr
- Expression to return when the if expression is not met<V> IfThenElseExpression<V> ifThenElse(BooleanExpression cond, Expression<V> thenValueExpr, V elseValue)
V
- type for the IfThenElseExpressioncond
- The if conditionthenValueExpr
- Expression to return when the if expression is metelseValue
- Value to return when the if expression is not met<V> IfThenElseExpression<V> ifThenElse(BooleanExpression cond, V thenValue, V elseValue)
V
- type for the IfThenElseExpressioncond
- The if conditionthenValue
- Value to return when the if expression is metelseValue
- Value to return when the if expression is not met<V> IfThenElseExpression<V> ifThen(Class<V> type, BooleanExpression cond, Expression<V> thenValueExpr)
V
- type for the IfThenElseExpressiontype
- The type returned by the IfElse.cond
- The if conditionthenValueExpr
- Expression for value to return when the if expression is met<V> IfThenElseExpression<V> ifThen(BooleanExpression cond, V thenValue)
V
- type for the IfThenElseExpressioncond
- The if conditionthenValue
- Value to return when the if expression is metJDOQLTypedQuery<T> groupBy(Expression<?>... exprs)
exprs
- Grouping expression(s)JDOQLTypedQuery<T> having(Expression<?> expr)
expr
- Having expressionJDOQLTypedQuery<T> orderBy(OrderExpression<?>... orderExprs)
orderExprs
- Ordering expression(s)JDOQLTypedQuery<T> result(boolean distinct, Expression<?>... exprs)
distinct
- Whether results are distinctexprs
- The result expressionsJDOQLTypedQuery<T> range(NumericExpression<?> lowerInclExpr, NumericExpression<?> upperExclExpr)
lowerInclExpr
- The position of the first result (inclusive)upperExclExpr
- The position of the last result (exclusive)JDOQLTypedQuery<T> range(long lowerIncl, long upperExcl)
lowerIncl
- The position of the first result (inclusive)upperExcl
- The position of the last result (exclusive)JDOQLTypedQuery<T> range(Expression<?> paramLowerInclExpr, Expression<?> paramUpperExclExpr)
paramLowerInclExpr
- Expression for a parameter defining the position of the first result (inclusive)paramUpperExclExpr
- Expression for a parameter defining the position of the last result (exclusive)JDOQLTypedSubquery<T> subquery(String candidateAlias)
candidateAlias
- Alias for the candidate<S> JDOQLTypedSubquery<S> subquery(Class<S> candidate, String candidateAlias)
S
- Candidate type for subquerycandidate
- Candidate for the subquerycandidateAlias
- Alias for the candidate<E> JDOQLTypedSubquery<E> subquery(CollectionExpression<Collection<E>,E> candidateCollection, Class<E> candidate, String candidateAlias)
E
- Candidate type for subquerycandidateCollection
- Expression defining the candidate collection for the subquerycandidate
- Candidate for the subquerycandidateAlias
- Alias for the candidateJDOQLTypedQuery<T> setParameters(Map<String,?> namedParamMap)
namedParamMap
- The map of parameter values keyed by their names.JDOQLTypedQuery<T> setParameter(Expression<?> paramExpr, Object value)
paramExpr
- Expression defining the parametervalue
- The valueJDOQLTypedQuery<T> setParameter(String paramName, Object value)
paramName
- Parameter namevalue
- The valueList<T> executeList()
Calling this method with a result being specified will result in JDOUserException being thrown.
T executeUnique()
Calling this method with a result being specified will result in JDOUserException being thrown.
<R> List<R> executeResultList(Class<R> resultCls)
Calling this method with no result being specified will result in JDOUserException being thrown.
R
- result typeresultCls
- Result class<R> R executeResultUnique(Class<R> resultCls)
Calling this method with no result being specified will result in JDOUserException being thrown.
R
- result typeresultCls
- Result classList<Object> executeResultList()
Calling this method with no result being specified will result in JDOUserException being thrown.
Object executeResultUnique()
Calling this method with no result being specified will result in JDOUserException being thrown.
long deletePersistentAll()
Integer getDatastoreReadTimeoutMillis()
PersistenceManager.setDatastoreReadTimeoutMillis(Integer)
JDOQLTypedQuery<T> datastoreReadTimeoutMillis(Integer interval)
interval
- The intervalInteger getDatastoreWriteTimeoutMillis()
PersistenceManager.setDatastoreWriteTimeoutMillis(Integer)
JDOQLTypedQuery<T> datastoreWriteTimeoutMillis(Integer interval)
interval
- The intervalBoolean getSerializeRead()
JDOQLTypedQuery<T> serializeRead(Boolean serialize)
serialize
- Whether to lockboolean isUnmodifiable()
JDOQLTypedQuery<T> unmodifiable()
boolean getIgnoreCache()
JDOQLTypedQuery<T> ignoreCache(boolean flag)
flag
- Whether to ignore the cacheJDOQLTypedQuery<T> extension(String key, Object value)
key
- The extension keyvalue
- The extension valueJDOQLTypedQuery<T> extensions(Map values)
values
- The extension map of keys and valuesJDOQLTypedQuery<T> saveAsNamedQuery(String name)
name
- Name to save it under.PersistenceManager getPersistenceManager()
FetchPlan getFetchPlan()
void cancelAll()
void cancel(Thread thread)
thread
- The thread to cancelvoid close(Object result)
result
- The resultvoid closeAll()
Copyright © 2005–1970 Apache Software Foundation. All rights reserved.