public class JPQLQuery
extends org.datanucleus.store.query.AbstractJPQLQuery
Modifier and Type | Field and Description |
---|---|
protected RDBMSQueryCompilation |
datastoreCompilation
The compilation of the query for this datastore.
|
static String |
EXTENSION_FOR_UPDATE_NOWAIT
Extension to add NOWAIT when using FOR UPDATE (when supported).
|
static String |
EXTENSION_USE_IS_NULL_WHEN_EQUALS_NULL_PARAM
Extension for whether to convert "== ?" with null parameter to "IS NULL".
|
candidateCollection, singleString
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, EXTENSION_CHECK_UNUSED_PARAMETERS, EXTENSION_CLOSE_RESULTS_AT_EC_CLOSE, EXTENSION_COMPILATION_CACHED, EXTENSION_EVALUATE_IN_MEMORY, EXTENSION_EXCLUDE_SUBCLASSES, EXTENSION_FLUSH_BEFORE_EXECUTION, EXTENSION_JDOQL_STRICT, EXTENSION_JPQL_STRICT, EXTENSION_LOAD_RESULTS_AT_COMMIT, EXTENSION_MULTITHREAD, EXTENSION_RESULT_CACHE_TYPE, EXTENSION_RESULT_SIZE_METHOD, EXTENSION_RESULTS_CACHED, EXTENSION_USE_FETCH_PLAN, extensions, filter, from, fromInclNo, fromInclParam, grouping, having, ignoreCache, implicitParameters, imports, inputParameters, ordering, OTHER, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, storeMgr, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update
Constructor and Description |
---|
JPQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec)
Constructs a new query instance that uses the given object manager.
|
JPQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec,
JPQLQuery q)
Constructs a new query instance having the same criteria as the given query.
|
JPQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec,
String query)
Constructor for a JPQL query where the query is specified using the "Single-String" format.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(String key,
Object value)
Add a vendor-specific extension this query.
|
protected void |
assertSupportsCancel()
Method that will throw an
UnsupportedOperationException if the query implementation doesn't
support cancelling queries. |
protected boolean |
cancelTaskObject(Object obj) |
protected void |
compileInternal(Map parameterValues)
Method to compile the JPQL query.
|
protected void |
compileQueryDelete(Map parameterValues,
org.datanucleus.metadata.AbstractClassMetaData candidateCmd)
Method to compile the query for RDBMS for a bulk delete.
|
protected void |
compileQueryUpdate(Map parameterValues,
org.datanucleus.metadata.AbstractClassMetaData candidateCmd)
Method to compile the query for RDBMS for a bulk update.
|
protected void |
discardCompiled()
Utility to remove any previous compilation of this Query.
|
RDBMSQueryCompilation |
getDatastoreCompilation() |
Object |
getNativeQuery() |
protected String |
getQueryCacheKey()
Method to get key for query cache
|
String |
getSQL()
Convenience accessor for the SQL to invoke in the datastore for this query.
|
Set<String> |
getSupportedExtensions()
Method to return the names of the extensions supported by this query.
|
protected boolean |
isCompiled()
Method to return if the query is compiled.
|
protected Object |
performExecute(Map parameters) |
boolean |
processesRangeInDatastoreQuery() |
void |
setExtensions(Map extensions)
Set multiple extensions, or use null to clear extensions.
|
void |
setImplicitParameter(int position,
Object value) |
void |
setImplicitParameter(String name,
Object value) |
protected boolean |
supportsTimeout()
Convenience method for whether this query supports timeouts.
|
compileGeneric, compileSubqueries, getLanguage, getSingleStringQuery, resolveClassDeclaration, setResult
dereferenceFilter, evaluateInMemory, performDeletePersistentAll, setCandidates, setCandidates, toString
addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, assertIsOpen, cancel, cancel, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, equals, execute, executeQuery, executeWithArray, executeWithMap, executionContextClosing, getBooleanExtensionProperty, getCandidateClass, getCandidateClassMetaData, getCandidateClassName, getCompilation, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getExecutionContext, getExplicitParametersDeclaration, getExplicitVariablesDeclaration, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImportsDeclaration, getInputParameters, getOrdering, getParameterMapForValues, getParsedImports, getQueryManager, getRange, getRangeFromIncl, getRangeFromInclParam, getRangeToExcl, getRangeToExclParam, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getStringExtensionProperty, getSubqueryForVariable, getType, getUpdate, hashCode, hasSubqueryForVariable, isSubclasses, isUnique, isUnmodifiable, prepareDatastore, registerTask, setCacheResults, setCandidateClass, setCandidateClassName, setCompilation, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setFetchPlan, setFilter, setFrom, setGrouping, setHaving, setIgnoreCache, setOrdering, setRange, setRange, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow, useCaching, useFetchPlan, useResultsCaching
public static final String EXTENSION_USE_IS_NULL_WHEN_EQUALS_NULL_PARAM
public static final String EXTENSION_FOR_UPDATE_NOWAIT
protected transient RDBMSQueryCompilation datastoreCompilation
public JPQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec)
storeMgr
- StoreManager for this queryec
- execution contextpublic JPQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, JPQLQuery q)
storeMgr
- StoreManager for this queryec
- execution contextq
- The query from which to copy criteria.public JPQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, String query)
storeMgr
- StoreManager for this queryec
- The ExecutionContextquery
- The single-string query formpublic void setImplicitParameter(int position, Object value)
setImplicitParameter
in class org.datanucleus.store.query.Query
public void setImplicitParameter(String name, Object value)
setImplicitParameter
in class org.datanucleus.store.query.Query
protected void discardCompiled()
discardCompiled
in class org.datanucleus.store.query.AbstractJavaQuery
protected boolean isCompiled()
isCompiled
in class org.datanucleus.store.query.Query
protected String getQueryCacheKey()
getQueryCacheKey
in class org.datanucleus.store.query.AbstractJPQLQuery
protected void compileInternal(Map parameterValues)
compileInternal
in class org.datanucleus.store.query.AbstractJPQLQuery
parameterValues
- Map of param values keyed by param name (if available at compile time)public String getSQL()
protected Object performExecute(Map parameters)
performExecute
in class org.datanucleus.store.query.Query
protected void assertSupportsCancel()
UnsupportedOperationException
if the query implementation doesn't
support cancelling queries.assertSupportsCancel
in class org.datanucleus.store.query.Query
protected boolean cancelTaskObject(Object obj)
cancelTaskObject
in class org.datanucleus.store.query.Query
protected boolean supportsTimeout()
supportsTimeout
in class org.datanucleus.store.query.Query
public Set<String> getSupportedExtensions()
getSupportedExtensions
in class org.datanucleus.store.query.Query
public boolean processesRangeInDatastoreQuery()
processesRangeInDatastoreQuery
in class org.datanucleus.store.query.Query
protected void compileQueryUpdate(Map parameterValues, org.datanucleus.metadata.AbstractClassMetaData candidateCmd)
parameterValues
- The parameter values (if any)candidateCmd
- Meta-data for the candidate classprotected void compileQueryDelete(Map parameterValues, org.datanucleus.metadata.AbstractClassMetaData candidateCmd)
parameterValues
- The parameter values (if any)candidateCmd
- Meta-data for the candidate classpublic void addExtension(String key, Object value)
addExtension
in class org.datanucleus.store.query.Query
key
- the extension keyvalue
- the extension valuepublic void setExtensions(Map extensions)
setExtensions
in class org.datanucleus.store.query.Query
extensions
- Query extensionspublic RDBMSQueryCompilation getDatastoreCompilation()
public Object getNativeQuery()
getNativeQuery
in class org.datanucleus.store.query.Query
Copyright © 2017. All rights reserved.