public abstract class AbstractSQLQuery extends Query
Query.SubqueryDefinition| Modifier and Type | Field and Description |
|---|---|
protected String |
compiledSQL
The actual SQL issued at execution time.
|
protected String |
inputSQL
The statement that the user specified to the Query.
|
protected QueryResultMetaData |
resultMetaData
MetaData defining the results of the query.
|
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 |
|---|
AbstractSQLQuery(StoreManager storeMgr,
ExecutionContext ec,
AbstractSQLQuery query)
Constructs a new query instance from the existing query.
|
AbstractSQLQuery(StoreManager storeMgr,
ExecutionContext ec,
String sqlText)
Constructs a new query instance having the same criteria as the given query.
|
| Modifier and Type | Method and Description |
|---|---|
void |
declareExplicitParameters(String parameters)
Declare the explicit parameters to be used in the query.
|
void |
declareExplicitVariables(String variables)
Declare the unbound variables to be used in the query.
|
void |
declareImports(String imports)
Set the import statements to be used to identify the fully qualified name of variables or parameters.
|
protected void |
discardCompiled()
Utility to discard any compiled query.
|
Object |
executeWithArray(Object[] parameters)
Execute the query and return the filtered List.
|
Object |
executeWithMap(Map executeParameters)
Execute the query using the input Map of parameters.
|
String |
getInputSQL()
Accessor for the user-input SQL query.
|
String |
getLanguage()
Accessor for the query language.
|
protected long |
performDeletePersistentAll(Map parameters)
Execute the query to delete persistent objects.
|
protected Map |
prepareForExecution(Map executeParameters)
Method to process the input parameters preparing the statement and parameters for execution.
|
void |
setCandidates(Collection pcs)
Set the candidate Collection to query.
|
void |
setCandidates(Extent pcs)
Set the candidate Extent to query.
|
void |
setFilter(String filter)
Set the filter for the query.
|
void |
setGrouping(String grouping)
Set the grouping specification for the result Collection.
|
void |
setOrdering(String ordering)
Set the ordering specification for the result Collection.
|
void |
setRange(int fromIncl,
int toExcl)
Set the range of the results.
|
void |
setResult(String result)
Set the result for the results.
|
void |
setResultClass(Class result_cls)
Set the result class for the results.
|
void |
setResultMetaData(QueryResultMetaData qrmd)
Method to set the MetaData defining the result.
|
void |
setSubclasses(boolean subclasses)
Method to set whether to use subclasses.
|
protected boolean |
shouldReturnSingleRow()
Convenience method to return whether the query should return a single row.
|
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, assertIsOpen, assertSupportsCancel, cancel, cancel, cancelTaskObject, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, compileInternal, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, equals, 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, hashCode, hasSubqueryForVariable, isCompiled, isSubclasses, isUnique, isUnmodifiable, performExecute, prepareDatastore, processesRangeInDatastoreQuery, 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, useResultsCachingprotected final transient String inputSQL
protected transient String compiledSQL
protected QueryResultMetaData resultMetaData
public AbstractSQLQuery(StoreManager storeMgr, ExecutionContext ec, AbstractSQLQuery query)
storeMgr - StoreManager for this queryec - ExecutionContextquery - Existing querypublic AbstractSQLQuery(StoreManager storeMgr, ExecutionContext ec, String sqlText)
storeMgr - StoreManager for this queryec - The ExecutionContextsqlText - The SQL query stringpublic String getLanguage()
QuerygetLanguage in class Queryprotected void discardCompiled()
discardCompiled in class QueryQuery.discardCompiled()public String getInputSQL()
public void setCandidates(Extent pcs)
setCandidates in class Querypcs - the Candidate Extent.NucleusUserException - Always thrown since method not applicablepublic void setCandidates(Collection pcs)
setCandidates in class Querypcs - the Candidate collection.NucleusUserException - Always thrown since method not applicablepublic void setResult(String result)
setResult in class Queryresult - The result parameter consists of the optional keyword
distinct followed by a commaseparated list of named result expressions or
a result class specification.NucleusUserException - Always thrown.public void setResultMetaData(QueryResultMetaData qrmd)
setResultMetaData in class Queryqrmd - Query Result MetaDatapublic void setResultClass(Class result_cls)
setResultClass in class Queryresult_cls - The result classpublic void setRange(int fromIncl,
int toExcl)
fromIncl - From element no (inclusive) to returntoExcl - To element no (exclusive) to returnNucleusUserException - Always thrown.public void setSubclasses(boolean subclasses)
setSubclasses in class Querysubclasses - Whether to use subclassesNucleusUserException - Always thrown.public void setFilter(String filter)
setFilter in class Queryfilter - the query filter.NucleusUserException - Always thrown since method not applicablepublic void declareExplicitVariables(String variables)
declareExplicitVariables in class Queryvariables - the variables separated by semicolons.NucleusUserException - Always thrown since method not applicablepublic void declareExplicitParameters(String parameters)
declareExplicitParameters in class Queryparameters - the parameters separated by semicolons.NucleusUserException - Always thrown.public void declareImports(String imports)
declareImports in class Queryimports - import statements separated by semicolons.NucleusUserException - Always thrown.public void setGrouping(String grouping)
setGrouping in class Querygrouping - the grouping specification.NucleusUserException - Always thrown.public void setOrdering(String ordering)
setOrdering in class Queryordering - the ordering specification.NucleusUserException - Always thrown.protected long performDeletePersistentAll(Map parameters)
performDeletePersistentAll in class Queryparameters - the Map containing all of the parameters.public Object executeWithArray(Object[] parameters)
executeWithArray in class Queryparameters - the Object array with all of the parameters.Query.executeQuery(Map parameters)public Object executeWithMap(Map executeParameters)
executeWithMap in class QueryexecuteParameters - the Map of the parameters passed in to execute().Query.executeQuery(Map parameters)protected Map prepareForExecution(Map executeParameters)
executeParameters - The input parameters mapprotected boolean shouldReturnSingleRow()
shouldReturnSingleRow in class QueryCopyright © 2015. All rights reserved.