T - Candidate class for this querypublic class JDOQuery<T> extends Object implements javax.jdo.Query<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
JDOQL_QUERY_LANGUAGE |
static String |
JPQL_QUERY_LANGUAGE |
static String |
PROPERTY_CLOSEABLE_QUERY |
static String |
SQL_QUERY_LANGUAGE |
| Constructor and Description |
|---|
JDOQuery(javax.jdo.PersistenceManager pm,
org.datanucleus.store.query.Query<T> query,
String language)
Constructor for a query used by JDO.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(String key,
Object value)
Method to add an extension to the query.
|
void |
addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr)
Add a subquery to this query.
|
void |
addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
Map parameters)
Add a subquery to this query.
|
void |
addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String... parameters)
Add a subquery to this query.
|
void |
addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String parameter)
Add a subquery to this query.
|
protected void |
assertIsOpen()
Method to assert if this Query is open.
|
void |
cancel(Thread thr)
Method to cancel the executing query for the supplied thread.
|
void |
cancelAll()
Method to cancel any executing queries.
|
void |
close() |
void |
close(Object queryResult)
Close the query result.
|
void |
closeAll()
Close all query results for this query.
|
void |
compile()
Compile the query.
|
javax.jdo.Query<T> |
datastoreReadTimeoutMillis(Integer interval) |
javax.jdo.Query<T> |
datastoreWriteTimeoutMillis(Integer interval) |
void |
declareImports(String imports)
Declare any imports for the query.
|
void |
declareParameters(String parameters)
Declare any parameters for the query.
|
void |
declareVariables(String variables)
Declare any variables for the query.
|
long |
deletePersistentAll()
Execute the query deleting all instances found.
|
long |
deletePersistentAll(Map parameters)
Execute the query deleting all instances found.
|
long |
deletePersistentAll(Object... parameters)
Execute the query deleting all instances found.
|
protected long |
deletePersistentInternal() |
Object |
execute()
Execute the query.
|
Object |
execute(Object p1)
Execute the query.
|
Object |
execute(Object p1,
Object p2)
Execute the query.
|
Object |
execute(Object p1,
Object p2,
Object p3)
Execute the query.
|
protected Object |
executeInternal() |
List<T> |
executeList() |
List<Object> |
executeResultList() |
<R> List<R> |
executeResultList(Class<R> resultCls) |
Object |
executeResultUnique() |
<R> R |
executeResultUnique(Class<R> resultCls) |
T |
executeUnique() |
Object |
executeWithArray(Object... parameterValues)
Execute the query.
|
Object |
executeWithMap(Map parameters)
Execute the query.
|
javax.jdo.Query<T> |
extension(String key,
Object value) |
javax.jdo.Query<T> |
extensions(Map values) |
javax.jdo.Query<T> |
filter(String filter) |
Integer |
getDatastoreReadTimeoutMillis()
Accessor for the datastore read timeout.
|
Integer |
getDatastoreWriteTimeoutMillis()
Accessor for the datastore write timeout.
|
javax.jdo.FetchPlan |
getFetchPlan()
Accessor for the fetch plan to use.
|
boolean |
getIgnoreCache()
Accessor for the ignore cache setting
|
org.datanucleus.store.query.Query<T> |
getInternalQuery()
Accessor for the internal query.
|
String |
getLanguage()
Accessor for the query language.
|
Object |
getNativeQuery()
Accessor for the native query invoked by this query (if known at this time and supported by the store plugin).
|
javax.jdo.PersistenceManager |
getPersistenceManager()
Accessor for the PersistenceManager.
|
Boolean |
getSerializeRead()
Accessor for whether to serialise any read objects in this query.
|
javax.jdo.Query<T> |
groupBy(String grouping) |
javax.jdo.Query<T> |
ignoreCache(boolean flag) |
javax.jdo.Query<T> |
imports(String imports) |
boolean |
isClosed()
Accessor for whether this Query is closed.
|
boolean |
isUnmodifiable()
Accessor for whether the query is modifiable.
|
javax.jdo.Query<T> |
orderBy(String ordering) |
javax.jdo.Query<T> |
parameters(String parameters) |
javax.jdo.Query<T> |
range(long fromIncl,
long toExcl) |
javax.jdo.Query<T> |
range(String range) |
javax.jdo.Query<T> |
result(String result) |
javax.jdo.Query<T> |
saveAsNamedQuery(String name)
Save this query as a named query with the specified name.
|
javax.jdo.Query<T> |
serializeRead(Boolean serialize) |
void |
setCandidates(Collection<T> pcs)
Set the candidates for the query.
|
void |
setCandidates(javax.jdo.Extent<T> extent)
Set the candidates for the query.
|
void |
setClass(Class<T> candidateClass)
Set the candidate class for the query.
|
void |
setDatastoreReadTimeoutMillis(Integer timeout)
Set the datastore read timeout.
|
void |
setDatastoreWriteTimeoutMillis(Integer timeout)
Set the datastore write timeout.
|
void |
setExtensions(Map extensions)
Set the extensions for the query.
|
void |
setFilter(String filter)
Set the filter for the query.
|
void |
setGrouping(String grouping)
Set the grouping for the query.
|
void |
setIgnoreCache(boolean ignoreCache)
Set the ignore cache setting for the query.
|
javax.jdo.Query<T> |
setNamedParameters(Map<String,?> paramMap) |
void |
setOrdering(String ordering)
Set the ordering for the query.
|
javax.jdo.Query<T> |
setParameters(Object... paramValues) |
void |
setRange(long fromIncl,
long toExcl)
Set the range for the query.
|
void |
setRange(String range)
Set the range for the query.
|
void |
setResult(String result)
Set the result for the query.
|
void |
setResultClass(Class result_cls)
Set the result class for the query.
|
void |
setSerializeRead(Boolean serialize)
Mutator for whether to serialise any read objects.
|
void |
setUnique(boolean unique)
Set whether to expect a unique result.
|
void |
setUnmodifiable()
Set the query to be unmodifiable.
|
javax.jdo.Query<T> |
subquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr) |
javax.jdo.Query<T> |
subquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
Map parameters) |
javax.jdo.Query<T> |
subquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String... parameters) |
javax.jdo.Query<T> |
subquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String parameter) |
String |
toString()
Convenience method to return the query in string form.
|
javax.jdo.Query<T> |
unmodifiable() |
javax.jdo.Query<T> |
variables(String variables) |
public static final String PROPERTY_CLOSEABLE_QUERY
public static final String JDOQL_QUERY_LANGUAGE
public static final String JPQL_QUERY_LANGUAGE
public static final String SQL_QUERY_LANGUAGE
public void close()
close in interface AutoCloseableclose in interface javax.jdo.Query<T>public boolean isClosed()
public void close(Object queryResult)
close in interface javax.jdo.Query<T>queryResult - Query resultpublic void closeAll()
closeAll in interface javax.jdo.Query<T>public void compile()
compile in interface javax.jdo.Query<T>public void declareImports(String imports)
declareImports in interface javax.jdo.Query<T>imports - The importspublic void declareParameters(String parameters)
declareParameters in interface javax.jdo.Query<T>parameters - The parameterspublic void declareVariables(String variables)
declareVariables in interface javax.jdo.Query<T>variables - The variablespublic javax.jdo.Query<T> imports(String imports)
imports in interface javax.jdo.Query<T>public javax.jdo.Query<T> parameters(String parameters)
parameters in interface javax.jdo.Query<T>public javax.jdo.Query<T> variables(String variables)
variables in interface javax.jdo.Query<T>public javax.jdo.Query<T> setParameters(Object... paramValues)
setParameters in interface javax.jdo.Query<T>public javax.jdo.Query<T> setNamedParameters(Map<String,?> paramMap)
setNamedParameters in interface javax.jdo.Query<T>public Object execute()
execute in interface javax.jdo.Query<T>public Object execute(Object p1)
execute in interface javax.jdo.Query<T>p1 - First param valuepublic Object execute(Object p1, Object p2)
execute in interface javax.jdo.Query<T>p1 - First param valuep2 - Second param valuepublic Object execute(Object p1, Object p2, Object p3)
execute in interface javax.jdo.Query<T>p1 - First param valuep2 - Second param valuep3 - Third param valuepublic Object executeWithArray(Object... parameterValues)
executeWithArray in interface javax.jdo.Query<T>parameterValues - Param valuespublic Object executeWithMap(Map parameters)
executeWithMap in interface javax.jdo.Query<T>parameters - Param valuespublic <R> List<R> executeResultList(Class<R> resultCls)
executeResultList in interface javax.jdo.Query<T>public <R> R executeResultUnique(Class<R> resultCls)
executeResultUnique in interface javax.jdo.Query<T>public List<Object> executeResultList()
executeResultList in interface javax.jdo.Query<T>public Object executeResultUnique()
executeResultUnique in interface javax.jdo.Query<T>protected Object executeInternal()
public long deletePersistentAll()
deletePersistentAll in interface javax.jdo.Query<T>public long deletePersistentAll(Object... parameters)
deletePersistentAll in interface javax.jdo.Query<T>parameters - Parameters to use when executingpublic long deletePersistentAll(Map parameters)
deletePersistentAll in interface javax.jdo.Query<T>parameters - Parameters to use when executingprotected long deletePersistentInternal()
public void cancelAll()
cancelAll in interface javax.jdo.Query<T>javax.jdo.JDOUnsupportedOptionException - if the datastore doesn't support cancellation of queriespublic void cancel(Thread thr)
cancel in interface javax.jdo.Query<T>javax.jdo.JDOUnsupportedOptionException - if the datastore doesn't support cancellation of queriespublic void setCandidates(javax.jdo.Extent<T> extent)
setCandidates in interface javax.jdo.Query<T>extent - Extent defining the candidatespublic void setCandidates(Collection<T> pcs)
setCandidates in interface javax.jdo.Query<T>pcs - PC candidatespublic void setClass(Class<T> candidateClass)
setClass in interface javax.jdo.Query<T>candidateClass - Candidate classpublic void addExtension(String key, Object value)
addExtension in interface javax.jdo.Query<T>key - Key for the extensionvalue - Value for the extensionpublic void setExtensions(Map extensions)
setExtensions in interface javax.jdo.Query<T>extensions - The extensionspublic javax.jdo.Query<T> extension(String key, Object value)
extension in interface javax.jdo.Query<T>public javax.jdo.Query<T> extensions(Map values)
extensions in interface javax.jdo.Query<T>public javax.jdo.FetchPlan getFetchPlan()
getFetchPlan in interface javax.jdo.Query<T>public javax.jdo.Query<T> filter(String filter)
filter in interface javax.jdo.Query<T>public void setFilter(String filter)
setFilter in interface javax.jdo.Query<T>filter - The query filterpublic javax.jdo.Query<T> groupBy(String grouping)
groupBy in interface javax.jdo.Query<T>public void setGrouping(String grouping)
setGrouping in interface javax.jdo.Query<T>grouping - The groupingpublic boolean getIgnoreCache()
getIgnoreCache in interface javax.jdo.Query<T>public void setIgnoreCache(boolean ignoreCache)
setIgnoreCache in interface javax.jdo.Query<T>ignoreCache - The ignore cache settingpublic javax.jdo.Query<T> ignoreCache(boolean flag)
ignoreCache in interface javax.jdo.Query<T>public javax.jdo.Query<T> orderBy(String ordering)
orderBy in interface javax.jdo.Query<T>public void setOrdering(String ordering)
setOrdering in interface javax.jdo.Query<T>ordering - The orderingpublic javax.jdo.PersistenceManager getPersistenceManager()
getPersistenceManager in interface javax.jdo.Query<T>public javax.jdo.Query<T> range(long fromIncl, long toExcl)
range in interface javax.jdo.Query<T>public javax.jdo.Query<T> range(String range)
range in interface javax.jdo.Query<T>public void setRange(String range)
setRange in interface javax.jdo.Query<T>range - The range specificationpublic void setRange(long fromIncl,
long toExcl)
setRange in interface javax.jdo.Query<T>fromIncl - From range inclusivetoExcl - To range exclusivepublic javax.jdo.Query<T> result(String result)
result in interface javax.jdo.Query<T>public void setResult(String result)
setResult in interface javax.jdo.Query<T>result - Result clausepublic void setResultClass(Class result_cls)
setResultClass in interface javax.jdo.Query<T>result_cls - Result classpublic void setDatastoreReadTimeoutMillis(Integer timeout)
setDatastoreReadTimeoutMillis in interface javax.jdo.Query<T>timeout - Timeout interval (millisecs)public Integer getDatastoreReadTimeoutMillis()
getDatastoreReadTimeoutMillis in interface javax.jdo.Query<T>public void setDatastoreWriteTimeoutMillis(Integer timeout)
setDatastoreWriteTimeoutMillis in interface javax.jdo.Query<T>timeout - Timeout interval (millisecs)public Integer getDatastoreWriteTimeoutMillis()
getDatastoreWriteTimeoutMillis in interface javax.jdo.Query<T>public javax.jdo.Query<T> datastoreReadTimeoutMillis(Integer interval)
datastoreReadTimeoutMillis in interface javax.jdo.Query<T>public javax.jdo.Query<T> datastoreWriteTimeoutMillis(Integer interval)
datastoreWriteTimeoutMillis in interface javax.jdo.Query<T>public void setUnique(boolean unique)
setUnique in interface javax.jdo.Query<T>unique - Whether results are uniquepublic boolean isUnmodifiable()
isUnmodifiable in interface javax.jdo.Query<T>public void setUnmodifiable()
setUnmodifiable in interface javax.jdo.Query<T>public javax.jdo.Query<T> unmodifiable()
unmodifiable in interface javax.jdo.Query<T>public void addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr)
addSubquery in interface javax.jdo.Query<T>sub - the subquery to add to this QueryvariableDecl - the name of the variable in the outer query to bind the results of the subquerycandidateExpr - the candidate collection of the subquery as an expression using terms of the outer querypublic void addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String parameter)
addSubquery in interface javax.jdo.Query<T>sub - the subquery to add to this QueryvariableDecl - the name of the variable to be used in this QuerycandidateExpr - the candidate collection to apply to the subqueryparameter - the expression from the outer query to bind the parameter in the subquerypublic void addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
String... parameters)
addSubquery in interface javax.jdo.Query<T>sub - the subquery to add to this QueryvariableDecl - the name of the variable to be used in this QuerycandidateExpr - the candidate collection to apply to the subqueryparameters - the expressions from the outer query to bind the parameter in the subquerypublic void addSubquery(javax.jdo.Query sub,
String variableDecl,
String candidateExpr,
Map parameters)
addSubquery in interface javax.jdo.Query<T>sub - the subquery to add to this QueryvariableDecl - the name of the variable to be used in this QuerycandidateExpr - the candidate collection to apply to the subqueryparameters - the expressions from the outer query to bind the parameter in the subquerypublic javax.jdo.Query<T> subquery(javax.jdo.Query sub, String variableDecl, String candidateExpr)
subquery in interface javax.jdo.Query<T>public javax.jdo.Query<T> subquery(javax.jdo.Query sub, String variableDecl, String candidateExpr, String parameter)
subquery in interface javax.jdo.Query<T>public javax.jdo.Query<T> subquery(javax.jdo.Query sub, String variableDecl, String candidateExpr, String... parameters)
subquery in interface javax.jdo.Query<T>public javax.jdo.Query<T> subquery(javax.jdo.Query sub, String variableDecl, String candidateExpr, Map parameters)
subquery in interface javax.jdo.Query<T>public Boolean getSerializeRead()
getSerializeRead in interface javax.jdo.Query<T>public void setSerializeRead(Boolean serialize)
setSerializeRead in interface javax.jdo.Query<T>serialize - Whether to serialise any read objects in this query.public javax.jdo.Query<T> serializeRead(Boolean serialize)
serializeRead in interface javax.jdo.Query<T>public org.datanucleus.store.query.Query<T> getInternalQuery()
public String getLanguage()
public javax.jdo.Query<T> saveAsNamedQuery(String name)
saveAsNamedQuery in interface javax.jdo.Query<T>name - The name to refer to it underpublic String toString()
public Object getNativeQuery()
protected void assertIsOpen()
javax.jdo.JDOFatalUserException - if the Query is closed.Copyright © 2020. All rights reserved.