Package org.datanucleus.store.query
Class AbstractStoredProcedureQuery
java.lang.Object
org.datanucleus.store.query.Query
org.datanucleus.store.query.AbstractStoredProcedureQuery
- All Implemented Interfaces:
Serializable
,ExecutionContextListener
Abstract representation of a stored procedure query.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.datanucleus.store.query.Query
Query.QueryType, Query.SubqueryDefinition
-
Field Summary
FieldsModifier and TypeFieldDescriptionRepository for holding output parameter values after execution.protected String
protected Class[]
Result classes for the result sets (optional).protected QueryResultMetaData[]
MetaData defining the results of the query (optional).protected int
private static final long
Fields inherited from class org.datanucleus.store.query.Query
candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, EXTENSION_CHECK_UNUSED_PARAMETERS, EXTENSION_CLOSE_RESULTS_AT_EC_CLOSE, EXTENSION_COMPILATION_CACHED, EXTENSION_COMPILE_OPTIMISE_VAR_THIS, EXTENSION_EVALUATE_IN_MEMORY, EXTENSION_EXCLUDE_SUBCLASSES, EXTENSION_FLUSH_BEFORE_EXECUTION, EXTENSION_JDOQL_ALLOW_ALL, EXTENSION_JDOQL_STRICT, EXTENSION_JPQL_ALLOW_RANGE, EXTENSION_JPQL_STRICT, EXTENSION_LOAD_RESULTS_AT_COMMIT, EXTENSION_QUERY_TYPE, EXTENSION_RESULT_CACHE_TYPE, EXTENSION_RESULT_CACHE_VALIDATE_OBJECTS, EXTENSION_RESULT_SIZE_METHOD, EXTENSION_RESULTS_CACHED, EXTENSION_SQL_ALLOW_ALL, EXTENSION_SQL_SYNTAX_CHECKS, EXTENSION_UPDATE_ALL_CANDIDATE_FIELDS, EXTENSION_USE_FETCH_PLAN, extensions, filter, from, fromInclNo, fromInclParam, grouping, having, ignoreCache, implicitParameters, imports, inputParameters, insertFields, insertSelectQuery, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, storeMgr, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractStoredProcedureQuery
(StoreManager storeMgr, ExecutionContext ec, String procName) Constructs a new query instance having the same criteria as the given query.AbstractStoredProcedureQuery
(StoreManager storeMgr, ExecutionContext ec, AbstractStoredProcedureQuery query) Constructs a new query instance from the existing query. -
Method Summary
Modifier and TypeMethodDescriptionAccessor for the query language.abstract Object
Accessor for the next result set.getOutputParameterValue
(int pos) Accessor for the value of the output parameter at the specified position.Accessor for the value of the output parameter with the specified name.abstract int
Accessor for the update count.abstract boolean
Accessor for whether there are more results after the current one.void
registerParameter
(int pos, Class type, StoredProcQueryParameterMode mode) void
registerParameter
(String name, Class type, StoredProcQueryParameterMode mode) void
setCandidates
(Collection pcs) Set the candidate Collection to query.void
setCandidates
(Extent pcs) Set the candidate Extent to query.void
setResultClasses
(Class[] resultClasses) Set the result class for the results.void
setResultMetaData
(QueryResultMetaData[] qrmds) Method to set the MetaData defining the result.Methods inherited from class org.datanucleus.store.query.Query
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, assertIsOpen, assertSupportsCancel, cancel, cancel, cancelTaskObject, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, compileInternal, declareExplicitParameters, declareExplicitVariables, declareImports, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, discardCompiled, 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, getInsertFields, getInsertSelectQuery, 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, performDeletePersistentAll, performExecute, prepareDatastore, processesRangeInDatastoreQuery, registerTask, resolveClassDeclaration, setCacheResults, setCandidateClass, setCandidateClassName, setCompilation, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setExtensions, setFetchPlan, setFilter, setFrom, setGrouping, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setInsertFields, setInsertSelectQuery, setOrdering, setRange, setRange, setResult, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow, supportsTimeout, useCaching, useFetchPlan, useResultsCaching
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
procedureName
-
storedProcParams
-
resultSetNumber
protected int resultSetNumber -
resultMetaDatas
MetaData defining the results of the query (optional). -
resultClasses
Result classes for the result sets (optional). -
outputParamValues
Repository for holding output parameter values after execution.
-
-
Constructor Details
-
AbstractStoredProcedureQuery
public AbstractStoredProcedureQuery(StoreManager storeMgr, ExecutionContext ec, AbstractStoredProcedureQuery query) Constructs a new query instance from the existing query.- Parameters:
storeMgr
- StoreManager for this queryec
- ExecutionContextquery
- Existing query
-
AbstractStoredProcedureQuery
Constructs a new query instance having the same criteria as the given query.- Parameters:
storeMgr
- StoreManager for this queryec
- The ExecutionContextprocName
- Name of the stored procedure in the datastore
-
-
Method Details
-
getLanguage
Description copied from class:Query
Accessor for the query language.- Overrides:
getLanguage
in classQuery
- Returns:
- Query language
-
setCandidates
Description copied from class:Query
Set the candidate Extent to query. To be implemented by extensions.- Specified by:
setCandidates
in classQuery
- Parameters:
pcs
- the Candidate Extent.
-
setCandidates
Description copied from class:Query
Set the candidate Collection to query. To be implemented by extensions.- Specified by:
setCandidates
in classQuery
- Parameters:
pcs
- the Candidate collection.
-
setResultMetaData
Method to set the MetaData defining the result. Setting this will unset the resultClass.- Parameters:
qrmds
- Query Result MetaData
-
setResultClasses
Set the result class for the results. Setting this will unset the resultMetaData.- Parameters:
resultClasses
- The result class
-
registerParameter
-
registerParameter
-
hasMoreResults
public abstract boolean hasMoreResults()Accessor for whether there are more results after the current one.- Returns:
- Whether there are more results
-
getNextResults
Accessor for the next result set.- Returns:
- Next results
-
getUpdateCount
public abstract int getUpdateCount()Accessor for the update count.- Returns:
- Update count
-
getOutputParameterValue
Accessor for the value of the output parameter at the specified position. Only to be called after execute().- Parameters:
pos
- Position- Returns:
- The value
-
getOutputParameterValue
Accessor for the value of the output parameter with the specified name. Only to be called after execute().- Parameters:
name
- Name of the parameter- Returns:
- The value
-