public interface Query<T> extends AutoCloseable, Serializable
Query
interface allows applications to obtain persistent
instances, values, and aggregate data from the data store.
The PersistenceManager
is the factory for Query
instances. There may be many Query
instances associated with a
PersistenceManager
. Multiple queries might be executed
simultaneously by different threads, but the implementation might choose to
execute them serially. In either case, the implementation must be thread-safe.
There are three required elements in a Query
: the class of
the results, the candidate collection of instances, and the filter.
There are optional elements: parameter declarations, variable declarations, import statements, ordering and grouping specifications, result and result class, the range of results, and flags indicating whether the query result is unique and whether the query can be modified.
The query namespace is modeled after methods in Java:
setClass
corresponds to the class definition
declareParameters
corresponds to formal parameters of a method
declareVariables
corresponds to local variables of a method
setFilter
and setOrdering
correspond to the method body
There are two namespaces in queries. Type names have their own namespace that is separate from the namespace for fields, variables and parameters.
The method setClass
introduces the name of the candidate
class in the type namespace. The method declareImports
introduces the names of the imported class or interface types in the type
namespace. Imported type names must be unique. When used (e.g. in a parameter
declaration, cast expression, etc.) a type name must be the name of the
candidate class, the name of a class or interface imported by method
declareImports
, or denote a class or interface from the same
package as the candidate class.
The method setClass
introduces the names of the candidate
class fields.
The method declareParameters
introduces the names of the
parameters. A name introduced by declareParameters
hides the
name of a candidate class field of the same name. Parameter names must be
unique.
The method declareVariables
introduces the names of the
variables. A name introduced by declareVariables
hides the name
of a candidate class field if equal. Variable names must be unique and must
not conflict with parameter names.
The result of the query by default is a list of result class instances,
but might be specified via setResult
. The class of the result
by default is the candidate class, but might be specified via setResultClass
.
A hidden field may be accessed using the 'this' qualifier: this.fieldName
.
The Query
interface provides methods which execute the query
based on the parameters given. They return a single instance or a
List
of result class instances which the
user can iterate to get results. The signature
of the execute
methods specifies that they return an
Object
which must be cast to the appropriate result by the user.
Any parameters passed to the execute
methods are used only
for this execution, and are not remembered for future execution.
Modifier and Type | Field and Description |
---|---|
static String |
JDOQL
The string constant used as the first argument to
PersistenceManager.newQuery(String,Object) to identify that the
created query should obey the JDOQL syntax and semantic rules. |
static String |
SQL
The string constant used as the first argument to
PersistenceManager.newQuery(String,Object) to identify that
the created query should use SQL semantics. |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(String key,
Object value)
Add a vendor-specific extension to this query.
|
void |
addSubquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression)
Add a subquery to this query.
|
void |
addSubquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
Map parameters)
Add a subquery to this query.
|
void |
addSubquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
String... parameters)
Add a subquery to this query.
|
void |
addSubquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
String parameter)
Add a subquery to this query.
|
void |
cancel(Thread thread)
Method to cancel an executing query in the specified thread.
|
void |
cancelAll()
Method to cancel any executing queries.
|
void |
close()
Don't use this method directly; use
closeAll() instead. |
void |
close(Object queryResult)
Close a query result and release any resources associated with it.
|
void |
closeAll()
Close all query results associated with this
Query
instance, and release all resources associated with them. |
void |
compile()
Verify the elements of the query and provide a hint to the query to
prepare and optimize an execution plan.
|
Query<T> |
datastoreReadTimeoutMillis(Integer interval)
Set the datastore read timeout (millis).
|
Query<T> |
datastoreWriteTimeoutMillis(Integer interval)
Set the datastore write timeout (millis).
|
void |
declareImports(String imports)
Set the import statements to be used to identify the fully qualified
name of variables or parameters.
|
void |
declareParameters(String parameters)
Declare the list of parameters query execution.
|
void |
declareVariables(String variables)
Declare the unbound variables to be used in the query.
|
long |
deletePersistentAll()
Deletes all the instances of the candidate class that pass the
filter.
|
long |
deletePersistentAll(Map parameters)
Deletes all the instances of the candidate class that pass the
filter.
|
long |
deletePersistentAll(Object... parameters)
Deletes all the instances of the candidate class that pass the
filter.
|
Object |
execute()
Execute the query and return the filtered Collection.
|
Object |
execute(Object p1)
Execute the query and return the filtered
Collection . |
Object |
execute(Object p1,
Object p2)
Execute the query and return the filtered
Collection . |
Object |
execute(Object p1,
Object p2,
Object p3)
Execute the query and return the filtered
Collection . |
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 a result type for the specified result.
|
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 a result type for the specified result.
|
T |
executeUnique()
Method to execute the query where there is a single row and we are returning the candidate type.
|
Object |
executeWithArray(Object... parameters)
Execute the query and return the filtered
Collection . |
Object |
executeWithMap(Map parameters)
Execute the query and return the filtered
Collection . |
Query<T> |
extension(String key,
Object value)
Specify an extension for this query.
|
Query<T> |
extensions(Map values)
Specify a map of extensions for this query.
|
Query<T> |
filter(String filter)
Set the filter for the query.
|
Integer |
getDatastoreReadTimeoutMillis()
Get the effective timeout setting for read operations.
|
Integer |
getDatastoreWriteTimeoutMillis()
Get the effective timeout setting for write operations.
|
FetchPlan |
getFetchPlan()
Returns the
FetchPlan used by this
Query . |
boolean |
getIgnoreCache()
Get the ignoreCache option setting.
|
PersistenceManager |
getPersistenceManager()
Get the
PersistenceManager associated with this
Query . |
Boolean |
getSerializeRead()
Return the current value of the serializeRead property.
|
Query<T> |
groupBy(String group)
Set the grouping expressions, optionally including a "having" clause.
|
Query<T> |
ignoreCache(boolean flag)
Set whether we to ignore the cache with this query.
|
Query<T> |
imports(String imports)
Set the import statements to be used to identify the fully qualified name of variables or parameters.
|
boolean |
isUnmodifiable()
The unmodifiable flag, when set, disallows further
modification of the query, except for specifying the range,
result class, and ignoreCache option.
|
Query<T> |
orderBy(String ordering)
Set the ordering specification for the result
Collection . |
Query<T> |
parameters(String parameters)
Declare the list of parameters for query execution.
|
Query<T> |
range(long fromIncl,
long toExcl)
Set the range of results to return.
|
Query<T> |
range(String fromInclToExcl)
Set the range of results to return.
|
Query<T> |
result(String result)
Set the result clause for the query.
|
Query<T> |
saveAsNamedQuery(String name)
Save the query, as it is currently defined, as a named query under the specified name.
|
Query<T> |
serializeRead(Boolean serialize)
Set whether we to lock all objects read by this query.
|
void |
setCandidates(Collection<T> pcs)
Set the candidate
Collection to query. |
void |
setCandidates(Extent<T> pcs)
Set the candidate
Extent to query. |
void |
setClass(Class<T> cls)
Set the class of the candidate instances of the query.
|
void |
setDatastoreReadTimeoutMillis(Integer interval)
Specify a timeout interval (milliseconds) for any read operations
associated with this query.
|
void |
setDatastoreWriteTimeoutMillis(Integer interval)
Specify a timeout interval (milliseconds) for any write operations
associated with this query.
|
void |
setExtensions(Map extensions)
Set multiple extensions, or use null to clear all extensions.
|
void |
setFilter(String filter)
Set the filter for the query.
|
void |
setGrouping(String group)
Set the grouping expressions, optionally including a "having"
clause.
|
void |
setIgnoreCache(boolean ignoreCache)
Set the ignoreCache option.
|
Query<T> |
setNamedParameters(Map<String,?> namedParamMap)
Method to set the named parameters on this query prior to execution.
|
void |
setOrdering(String ordering)
Set the ordering specification for the result
Collection . |
Query<T> |
setParameters(Object... paramValues)
Method to set the values of the numbered parameters on this query prior to execution.
|
void |
setRange(long fromIncl,
long toExcl)
Set the range of results to return.
|
void |
setRange(String fromInclToExcl)
Set the range of results to return.
|
void |
setResult(String data)
Specifies what type of data this query should return.
|
void |
setResultClass(Class cls)
Specify the type of object in which to return each element of
the result of invoking
execute() or one of its siblings. |
void |
setSerializeRead(Boolean serialize)
If
true , a lock will be applied to all objects read in this
query. |
void |
setUnique(boolean unique)
Specify that only the first result of the query should be
returned, rather than a collection.
|
void |
setUnmodifiable()
The unmodifiable flag, when set, disallows further
modification of the query, except for specifying the range,
result class, and ignoreCache option.
|
Query<T> |
subquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression)
Add a subquery to this query.
|
Query<T> |
subquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
Map parameters)
Add a subquery to this query.
|
Query<T> |
subquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
String... parameters)
Add a subquery to this query.
|
Query<T> |
subquery(Query sub,
String variableDeclaration,
String candidateCollectionExpression,
String parameter)
Add a subquery to this query.
|
Query<T> |
unmodifiable()
Set whether to make this query unmodifiable.
|
Query<T> |
variables(String variables)
Declare the unbound variables to be used in the query.
|
static final String JDOQL
PersistenceManager.newQuery(String,Object)
to identify that the
created query should obey the JDOQL syntax and semantic rules.
This is the default query language used when creating a query with any
of the other PersistenceManager.newQuery()
methods, except
PersistenceManager.newQuery(Object)
, which uses the query
language of the compiled query template object passed to that method.
static final String SQL
PersistenceManager.newQuery(String,Object)
to identify that
the created query should use SQL semantics. This is only
meaningful for relational JDO implementations.
If this is used, the Object
argument to the
PersistenceManager.newQuery(String,Object)
method
should be a String
containing a SQL
SELECT
statement.
void setClass(Class<T> cls)
The class specifies the class
of the candidates of the query. Elements of the candidate collection
that are of the specified class are filtered before being
put into the result Collection
.
cls
- the Class
of the candidate instances.void setCandidates(Extent<T> pcs)
Extent
to query.pcs
- the candidate Extent
.void setCandidates(Collection<T> pcs)
Collection
to query.pcs
- the candidate Collection
.void setFilter(String filter)
The filter specification is a String
containing a Boolean
expression that is to be evaluated for each of the instances
in the candidate collection. If the filter is not specified,
then it defaults to "true", which has the effect of filtering
the input Collection
only for class type.
An element of the candidate collection is returned in the result if:
Class
of the Query
; and
true
.
The user may denote uniqueness in the filter expression by
explicitly declaring an expression (for example, e1 != e2
).
Rules for constructing valid expressions follow the Java language, except for these differences:
Date
fields and
Date
parameters are valid.
=
, +=
, etc. and
pre- and post-increment and -decrement are not supported. Therefore,
there are no side effects from evaluation of any expressions.
Collection.contains(Object o)
,
Collection.isEmpty()
,
String.startsWith(String s)
, and
String.endsWith(String e)
. Implementations might choose to
support non-mutating method calls as non-standard extensions.
null
-valued field, which would
throw NullPointerException
, is treated as if the filter
expression returned false
for the evaluation of the current
set of variable values. Other values for variables might still qualify
the candidate instance for inclusion in the result set.
Collection
types) is specified using a variable declaration and the
Collection.contains(Object o)
method.
Identifiers in the expression are considered to be in the name
space of the specified class, with the addition of declared imports,
parameters and variables. As in the Java language, this
is a
reserved word which means the element of the collection being evaluated.
Navigation through single-valued fields is specified by the Java
language syntax of field_name.field_name....field_name
.
A JDO implementation is allowed to reorder the filter expression for optimization purposes.
filter
- the query filter.void declareImports(String imports)
String
with
semicolon-separated statements.
The String
parameter to this method follows the syntax of
the import statement of the Java language.
imports
- import statements separated by semicolons.void declareParameters(String parameters)
String
containing one or more
query parameter declarations separated with commas. Each parameter named
in the parameter declaration must be bound to a value when
the query is executed.
The String
parameter to this method follows the syntax
for formal parameters in the Java language.
parameters
- the list of parameters separated by commas.void declareVariables(String variables)
String
containing one or more unbound variable declarations
separated with semicolons. It follows the syntax for local variables in
the Java language.variables
- the variables separated by semicolons.void setOrdering(String ordering)
Collection
.
The ordering specification is a String
containing one or
more ordering declarations separated by commas.
Each ordering declaration is the name of the field on which
to order the results followed by one of the following words:
"ascending
" or "descending
".
The field must be declared in the candidate class or must be a navigation expression starting with a field in the candidate class.
Valid field types are primitive types except boolean
;
wrapper types except Boolean
; BigDecimal
;
BigInteger
; String
; and Date
.
ordering
- the ordering specification.void setIgnoreCache(boolean ignoreCache)
PersistenceManagerFactory
or the
PersistenceManager
used to create this Query
.
The ignoreCache option setting specifies whether the query should execute
entirely in the back end, instead of in the cache. If this flag is set
to true
, an implementation might be able to optimize the
query execution by ignoring changed values in the cache. For optimistic
transactions, this can dramatically improve query response times.ignoreCache
- the setting of the ignoreCache option.boolean getIgnoreCache()
setIgnoreCache(boolean)
void compile()
Object execute()
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
Collection
.executeWithArray(Object[] parameters)
Object execute(Object p1)
Collection
.
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
p1
- the value of the first parameter declared.Collection
.executeWithArray(Object[] parameters)
Object execute(Object p1, Object p2)
Collection
.
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
p1
- the value of the first parameter declared.p2
- the value of the second parameter declared.Collection
.executeWithArray(Object[] parameters)
Object execute(Object p1, Object p2, Object p3)
Collection
.
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
p1
- the value of the first parameter declared.p2
- the value of the second parameter declared.p3
- the value of the third parameter declared.Collection
.executeWithArray(Object[] parameters)
Object executeWithMap(Map parameters)
Collection
. The
query is executed with the parameters set by the Map
values.
Each Map
entry consists of a key which is the name of the
parameter in the declareParameters
method, and a value which
is the value used in the execute
method. The keys in the
Map
and the declared parameters must exactly match or a
JDOUserException
is thrown.
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
parameters
- the Map
containing all of the parameters.Collection
.executeWithArray(Object[] parameters)
Object executeWithArray(Object... parameters)
Collection
.
The execution of the query obtains the values of the parameters and matches them against the declared parameters in order. The names of the declared parameters are ignored. The type of the declared parameters must match the type of the passed parameters, except that the passed parameters might need to be unwrapped to get their primitive values.
The filter, import, declared parameters, declared variables, and ordering statements are verified for consistency.
Each element in the candidate Collection
is examined to
see that it is assignment compatible to the Class
of the
query. It is then evaluated by the Boolean expression of the filter.
The element passes the filter if there exist unique values for all
variables for which the filter expression evaluates to true
.
Cancellation of the query using cancel() will result in JDOQueryInterruptedException being thrown here
parameters
- the Object
array with all of the parameters.Collection
.PersistenceManager getPersistenceManager()
PersistenceManager
associated with this
Query
.
If this Query
was restored from a serialized form, it has
no PersistenceManager
, and this method returns
null
.
PersistenceManager
associated with this
Query
.void close(Object queryResult)
execute(...)
and might have
iterators open on it. Iterators associated with the query result are
invalidated: they return false
to hasNext()
and throw NoSuchElementException
to next()
.queryResult
- the result of execute(...)
on this
Query
instance.void closeAll()
Query
instance, and release all resources associated with them. The query
results might have iterators open on them. Iterators associated with the
query results are invalidated:
they return false
to hasNext()
and throw
NoSuchElementException
to next()
.void close() throws Exception
closeAll()
instead. It is intended for use with try-with-resources.close
in interface AutoCloseable
Exception
- if this resource cannot be closedvoid setGrouping(String group)
group
- a comma-delimited list of expressions, optionally
followed by the "having" keyword and a boolean expressionvoid setUnique(boolean unique)
unique
- if true, only one element is returnedvoid setResult(String data)
null
, this query returns
instances of the query's candidate class. If set, this query
will return expressions, including field values (projections) and
aggregate function results.data
- a comma-delimited list of expressions
(fields, functions on fields, or aggregate functions)
to return from this queryvoid setResultClass(Class cls)
execute()
or one of its siblings.
If the result is not set or set to null, the result class defaults
to the candidate class of the query. If the result consists of one
expression, the result class defaults to the type of that expression.
If the result consists of more than one expression, the result class
defaults to Object[].
The result class may be specified to be one of the java.lang classes
Character, Boolean, Byte, Short, Integer, Long, Float, Double, String,
or Object[]; or one of the java.math classes BigInteger or BigDecimal;
or the java.util class Date; or one of the java.sql classes Date,
Time, or Timestamp; or a user-defined class.
If there are multiple result expressions, the result class must be able to hold all elements of the result specification or a JDOUserException is thrown.
If there is only one result expression, the result class must be assignable from the type of the result expression or must be able to hold all elements of the result specification. A single value must be able to be coerced into the specified result class (treating wrapper classes as equivalent to their unwrapped primitive types) or by matching. If the result class does not satisfy these conditions, a JDOUserException is thrown.
A constructor of a result class specified in the setResult method will be used if the results specification matches the parameters of the constructor by position and type. If more than one constructor satisfies the requirements, the JDO implementation chooses one of them. If no constructor satisfies the results requirements, or if the result class is specified via the setResultClass method, the following requirements apply:
set
or put
methods or
fields.
set
method that returns void and matches the name of the
result expression and takes a single parameter which is the
exact type of the result expression;
void put(Object, Object)
.
During processing of the results,
the first argument is the name of the result expression and
the second argument is the value from the query result.
set
methods.cls
- the result classvoid setRange(long fromIncl, long toExcl)
fromIncl
- 0-based inclusive start indextoExcl
- 0-based exclusive end index, or
Long.MAX_VALUE
for no limit.void setRange(String fromInclToExcl)
setRange("50, 70");
or
setRange(":from, :to");
or
setRange("50, :to");
.
The execution of the query is
modified to return only a subset of results. If the filter would
normally return 100 instances, and fromIncl is set to 50, and
toExcl is set to 70, then the first 50 results that would have
been returned are skipped, the next 20 results are returned and the
remaining 30 results are ignored. An implementation should execute
the query such that the range algorithm is done at the data store.fromInclToExcl
- comma-separated fromIncl and toExcl valuessetRange(long, long)
void addExtension(String key, Object value)
key
- the key of the extensionvalue
- the value of the extensionvoid setExtensions(Map extensions)
extensions
- the map of extensionsaddExtension(java.lang.String, java.lang.Object)
FetchPlan getFetchPlan()
FetchPlan
used by this
Query
. Modifications of the returned fetch plan will not
cause this query's owning PersistenceManager
's
FetchPlan
to be modified.long deletePersistentAll(Object... parameters)
parameters
- for the querydeletePersistentAll()
long deletePersistentAll(Map parameters)
parameters
- for the querydeletePersistentAll()
long deletePersistentAll()
Dirty instances of affected classes in the cache are first
flushed to the datastore. Instances in the cache or brought into
the cache as a result of executing one of the
deletePersistentAll
methods undergo life cycle changes as if deletePersistent
were called on them.
Specifically, if the class of deleted instances implements the delete callback interface, the corresponding callback methods are called on the deleted instances. Similarly, if there are lifecycle listeners registered for delete events on affected classes, the listener is called for each appropriate deleted instance.
Before returning control to the application, instances of affected classes in the cache are refreshed to reflect whether they were deleted from the datastore.
void setUnmodifiable()
boolean isUnmodifiable()
void addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression)
sub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable in the outer query
to bind the results of the subquerycandidateCollectionExpression
- the candidate collection
of the subquery as an expression using terms of the outer queryaddSubquery(Query sub, String variableDeclaration,
String candidateCollectionExpression, String... parameters)
void addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String parameter)
sub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable
to be used in this QuerycandidateCollectionExpression
- the candidate collection
to apply to the subqueryparameter
- the expression from the outer query to bind
the parameter in the subqueryaddSubquery(Query sub, String variableDeclaration,
String candidateCollectionExpression, String... parameters)
void addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String... parameters)
sub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable in the outer query
to bind the results of the subquerycandidateCollectionExpression
- the candidate collection
of the subquery as an expression using terms of the outer queryparameters
- the expressions from the outer query to bind
the parameters in the subqueryvoid addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression, Map parameters)
sub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable
to be used in this QuerycandidateCollectionExpression
- the candidate collection
to apply to the subqueryparameters
- the expressions from the outer query to bind
the parameter in the subqueryaddSubquery(Query sub, String variableDeclaration,
String candidateCollectionExpression, String... parameters)
void setDatastoreReadTimeoutMillis(Integer interval)
interval
- the timeout interval (milliseconds)Integer getDatastoreReadTimeoutMillis()
setDatastoreReadTimeoutMillis(Integer)
,
PersistenceManager.setDatastoreReadTimeoutMillis(Integer)
void setDatastoreWriteTimeoutMillis(Integer interval)
interval
- the timeout interval (milliseconds)Integer getDatastoreWriteTimeoutMillis()
setDatastoreWriteTimeoutMillis(Integer)
,
PersistenceManager.setDatastoreWriteTimeoutMillis(Integer)
void cancelAll()
void cancel(Thread thread)
thread
- The thread to cancelvoid setSerializeRead(Boolean serialize)
true
, a lock will be applied to all objects read in this
query.
If false
then retrieved objects will not be locked.
If null will fallback to the value for metadata for the class in question.
serialize
- the value of the serializeRead propertyBoolean getSerializeRead()
Query<T> saveAsNamedQuery(String name)
name
- Name to save it under.Query<T> filter(String filter)
setFilter(String)
methodfilter
- the query filter.Query<T> orderBy(String ordering)
Collection
.
Shortcut for the setOrdering(String)
methodordering
- the ordering specification.Query<T> groupBy(String group)
setGrouping(String)
methodgroup
- a comma-delimited list of expressions, optionally followed by the "having" keyword and a boolean expressionQuery<T> result(String result)
setResult(String)
methodresult
- The result clauseQuery<T> range(long fromIncl, long toExcl)
setRange(long, long)
methodfromIncl
- 0-based inclusive start indextoExcl
- 0-based exclusive end index, or Long.MAX_VALUE
for no limit.Query<T> range(String fromInclToExcl)
setRange(String)
methodfromInclToExcl
- comma-separated fromIncl and toExcl valuesQuery<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression)
subquery(Query, String, String)
methodsub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable in the outer query to bind the results of the subquerycandidateCollectionExpression
- the candidate collection of the subquery as an expression using terms of the outer queryQuery<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String parameter)
subquery(Query, String, String, String)
methodsub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable to be used in this QuerycandidateCollectionExpression
- the candidate collection to apply to the subqueryparameter
- the expression from the outer query to bind the parameter in the subqueryQuery<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String... parameters)
subquery(Query, String, String, String...)
methodsub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable in the outer query to bind the results of the subquerycandidateCollectionExpression
- the candidate collection of the subquery as an expression using terms of the outer queryparameters
- the expressions from the outer query to bind the parameters in the subqueryQuery<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, Map parameters)
subquery(Query, String, String, Map)
methodsub
- the subquery to add to this QueryvariableDeclaration
- the name of the variable to be used in this QuerycandidateCollectionExpression
- the candidate collection to apply to the subqueryparameters
- the expressions from the outer query to bind the parameter in the subqueryQuery<T> imports(String imports)
declareImports(String)
method.imports
- the imports declarationQuery<T> parameters(String parameters)
declareParameters(String)
method.parameters
- the list of parameters separated by commas.Query<T> variables(String variables)
declareVariables(String)
method.variables
- the variables separated by semicolons.Query<T> datastoreReadTimeoutMillis(Integer interval)
setDatastoreReadTimeoutMillis(Integer)
method.interval
- The intervalQuery<T> datastoreWriteTimeoutMillis(Integer interval)
setDatastoreWriteTimeoutMillis(Integer)
method.interval
- The intervalQuery<T> serializeRead(Boolean serialize)
setSerializeRead(Boolean)
method.serialize
- Whether to lockQuery<T> unmodifiable()
setUnmodifiable()
method.Query<T> ignoreCache(boolean flag)
setIgnoreCache(boolean)
method.flag
- Whether to ignore the cacheQuery<T> extension(String key, Object value)
addExtension(String, Object)
method.key
- The extension keyvalue
- The extension valueQuery<T> extensions(Map values)
setExtensions(Map)
method.values
- The extension map of keys and valuesQuery<T> setNamedParameters(Map<String,?> namedParamMap)
namedParamMap
- The map of parameter values keyed by their names.Query<T> setParameters(Object... paramValues)
paramValues
- Values of the numbered parameters, in order.List<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
- The result typeresultCls
- The result class<R> R executeResultUnique(Class<R> resultCls)
Calling this method with no result being specified will result in JDOUserException being thrown.
R
- The result typeresultCls
- The 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.
Copyright © 2005–1970 Apache Software Foundation. All rights reserved.