public final class SQLQuery
extends org.datanucleus.store.query.AbstractSQLQuery
Modifier and Type | Field and Description |
---|---|
protected boolean |
isCompiled
State variable for the compilation state
|
protected StatementMappingIndex[] |
stmtMappings
Mappings for the result of the query.
|
compiledSQL, inputSQL, resultMetaData
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_FLUSH_BEFORE_EXECUTION, 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 |
---|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec)
Constructs a new query instance having the same criteria as the given query.
|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec,
SQLQuery query)
Constructor for a new query using the existing query.
|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.ExecutionContext ec,
String queryString)
Constructs a new query instance for the provided single-string SQL query.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertSupportsCancel()
Method that will throw an
UnsupportedOperationException if the query implementation doesn't
support cancelling queries. |
static boolean |
columnNamesAreTheSame(DatastoreAdapter dba,
String name1,
String name2)
Convenience method to compare two column names.
|
void |
compileInternal(Map parameterValues)
Verify the elements of the query and provide a hint to the query to prepare and optimize an
execution plan.
|
protected void |
discardCompiled()
Utility to remove any previous compilation of this Query.
|
boolean |
equals(Object obj) |
protected String |
generateQueryStatement()
Method to perform any necessary pre-processing on the users query statement
before we execute it.
|
protected ResultObjectFactory |
getResultObjectFactoryForCandidateClass(ResultSet rs)
Method to generate a ResultObjectFactory for converting rows of the provided ResultSet into
instances of the candidate class.
|
int |
hashCode() |
protected boolean |
isCompiled()
Method to return if the query is compiled.
|
protected Object |
performExecute(Map parameters)
Execute the query and return the result.
|
boolean |
processesRangeInDatastoreQuery() |
declareExplicitParameters, declareExplicitVariables, declareImports, executeWithArray, executeWithMap, getInputSQL, getLanguage, performDeletePersistentAll, prepareForExecution, setCandidates, setCandidates, setFilter, setGrouping, setOrdering, setRange, setResult, setResultClass, setResultMetaData, setSubclasses, shouldReturnSingleRow
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, assertIsOpen, cancel, cancel, cancelTaskObject, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, execute, executeQuery, executionContextClosing, getBooleanExtensionProperty, getCandidateClass, getCandidateClassMetaData, getCandidateClassName, getCompilation, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getExecutionContext, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getNativeQuery, getOrdering, getParameterMapForValues, getParsedImports, getQueryManager, getRange, getRangeFromIncl, getRangeFromInclParam, getRangeToExcl, getRangeToExclParam, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getStringExtensionProperty, getSubqueryForVariable, getSupportedExtensions, getType, getUpdate, hasSubqueryForVariable, isSubclasses, isUnique, isUnmodifiable, prepareDatastore, registerTask, resolveClassDeclaration, setCacheResults, setCandidateClass, setCandidateClassName, setCompilation, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setExtensions, setFetchPlan, setFrom, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setRange, setRange, setResultClassName, setResultDistinct, setSerializeRead, setType, setUnique, setUnmodifiable, setUpdate, supportsTimeout, useCaching, useFetchPlan, useResultsCaching
protected transient boolean isCompiled
protected transient StatementMappingIndex[] stmtMappings
public SQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, SQLQuery query)
storeMgr
- StoreManager for this queryec
- execution contextquery
- The existing querypublic SQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec)
storeMgr
- StoreManager for this queryec
- execution contextpublic SQLQuery(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, String queryString)
storeMgr
- StoreManager for this queryec
- execution contextqueryString
- The SQL query stringpublic boolean equals(Object obj)
equals
in class org.datanucleus.store.query.Query
public int hashCode()
hashCode
in class org.datanucleus.store.query.Query
protected void discardCompiled()
discardCompiled
in class org.datanucleus.store.query.AbstractSQLQuery
protected boolean isCompiled()
isCompiled
in class org.datanucleus.store.query.Query
public boolean processesRangeInDatastoreQuery()
processesRangeInDatastoreQuery
in class org.datanucleus.store.query.Query
public void compileInternal(Map parameterValues)
compileInternal
in class org.datanucleus.store.query.Query
protected Object performExecute(Map parameters)
performExecute
in class org.datanucleus.store.query.Query
parameters
- the Map containing all of the parameters (positional parameters) (not null)protected void assertSupportsCancel()
UnsupportedOperationException
if the query implementation doesn't
support cancelling queries.assertSupportsCancel
in class org.datanucleus.store.query.Query
protected ResultObjectFactory getResultObjectFactoryForCandidateClass(ResultSet rs) throws SQLException
rs
- The ResultSetSQLException
- Thrown if an error occurs processing the ResultSetpublic static boolean columnNamesAreTheSame(DatastoreAdapter dba, String name1, String name2)
dba
- Datastore adaptername1
- The first name (from the datastore)name2
- The second name (from the user SQL statement)protected String generateQueryStatement()
Copyright © 2015. All rights reserved.