|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.query.Query
org.datanucleus.store.query.AbstractSQLQuery
org.datanucleus.store.rdbms.query.SQLQuery
public final class SQLQuery
A Query using SQL, and keeping to the JDO2 definition of a SQL query. The majority of this has to be specified in the query filter itself. There are no variables/imports. Ordering/grouping is explicit in the query.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.datanucleus.store.query.Query |
|---|
org.datanucleus.store.query.Query.SubqueryDefinition |
| Field Summary | |
|---|---|
protected boolean |
isCompiled
State variable for the compilation state |
protected static org.datanucleus.util.Localiser |
LOCALISER_RDBMS
Localiser of messages. |
protected org.datanucleus.store.mapped.StatementMappingIndex[] |
stmtMappings
Mappings for the result of the query. |
| Fields inherited from class org.datanucleus.store.query.AbstractSQLQuery |
|---|
compiledSQL, inputSQL, resultMetaData |
| Fields inherited from class org.datanucleus.store.query.Query |
|---|
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, EXTENSION_CHECK_UNUSED_PARAMETERS, 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, LOCALISER, ordering, OTHER, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, storeMgr, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update |
| Constructor Summary | |
|---|---|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec)
Constructs a new query instance having the same criteria as the given query. |
|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec,
SQLQuery query)
Constructor for a new query using the existing query. |
|
SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec,
java.lang.String queryString)
Constructs a new query instance for the provided single-string SQL query. |
|
| Method Summary | |
|---|---|
protected void |
assertSupportsCancel()
Method that will throw an UnsupportedOperationException if the query implementation doesn't
support cancelling queries. |
static boolean |
columnNamesAreTheSame(org.datanucleus.store.mapped.DatastoreAdapter dba,
java.lang.String name1,
java.lang.String name2)
Convenience method to compare two column names. |
void |
compileInternal(java.util.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(java.lang.Object obj)
Equality operator. |
protected java.lang.String |
generateQueryStatement()
Method to perform any necessary pre-processing on the users query statement before we execute it. |
protected org.datanucleus.store.query.ResultObjectFactory |
getResultObjectFactoryForCandidateClass(java.sql.ResultSet rs)
Method to generate a ResultObjectFactory for converting rows of the provided ResultSet into instances of the candidate class. |
protected boolean |
isCompiled()
Method to return if the query is compiled. |
protected java.lang.Object |
performExecute(java.util.Map parameters)
Execute the query and return the result. |
boolean |
processesRangeInDatastoreQuery()
|
| Methods inherited from class org.datanucleus.store.query.AbstractSQLQuery |
|---|
declareExplicitParameters, declareExplicitVariables, declareImports, executeWithArray, executeWithMap, getInputSQL, getLanguage, performDeletePersistentAll, prepareForExecution, setCandidates, setCandidates, setFilter, setGrouping, setOrdering, setRange, setResult, setResultClass, setResultMetaData, setSubclasses, shouldReturnSingleRow |
| Methods inherited from class org.datanucleus.store.query.Query |
|---|
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, cancel, cancel, cancelTaskObject, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, execute, executeQuery, getBooleanExtensionProperty, getCandidateClass, getCandidateClassName, getCompilation, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getExecutionContext, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getOrdering, getParameterMapForValues, getParsedImports, getQueryManager, getRange, getRangeFromIncl, getRangeFromInclParam, getRangeToExcl, getRangeToExclParam, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getStringExtensionProperty, getSubqueryForVariable, getSupportedExtensions, getType, getUpdate, hashCode, 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
protected transient boolean isCompiled
protected transient org.datanucleus.store.mapped.StatementMappingIndex[] stmtMappings
| Constructor Detail |
|---|
public SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec,
SQLQuery query)
storeMgr - StoreManager for this queryec - execution contextquery - The existing query
public SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec)
storeMgr - StoreManager for this queryec - execution context
public SQLQuery(org.datanucleus.store.StoreManager storeMgr,
org.datanucleus.store.ExecutionContext ec,
java.lang.String queryString)
storeMgr - StoreManager for this queryec - execution contextqueryString - The SQL query string| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class org.datanucleus.store.query.Queryobj - The object to compare against
protected void discardCompiled()
discardCompiled in class org.datanucleus.store.query.AbstractSQLQueryprotected boolean isCompiled()
isCompiled in class org.datanucleus.store.query.Querypublic boolean processesRangeInDatastoreQuery()
processesRangeInDatastoreQuery in class org.datanucleus.store.query.Querypublic void compileInternal(java.util.Map parameterValues)
compileInternal in class org.datanucleus.store.query.Queryprotected java.lang.Object performExecute(java.util.Map parameters)
performExecute in class org.datanucleus.store.query.Queryparameters - 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 org.datanucleus.store.query.ResultObjectFactory getResultObjectFactoryForCandidateClass(java.sql.ResultSet rs)
throws java.sql.SQLException
rs - The ResultSet
java.sql.SQLException - Thrown if an error occurs processing the ResultSet
public static boolean columnNamesAreTheSame(org.datanucleus.store.mapped.DatastoreAdapter dba,
java.lang.String name1,
java.lang.String name2)
dba - Datastore adaptername1 - The first name (from the datastore)name2 - The second name (from the user SQL statement)
protected java.lang.String generateQueryStatement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||