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
public abstract class AbstractStoredProcedureQuery extends Query
Abstract representation of a stored procedure query.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractStoredProcedureQuery.StoredProcedureParameter-
Nested classes/interfaces inherited from class org.datanucleus.store.query.Query
Query.QueryType, Query.SubqueryDefinition
-
-
Field Summary
Fields Modifier and Type Field Description protected MapoutputParamValuesRepository for holding output parameter values after execution.protected StringprocedureNameprotected Class[]resultClassesResult classes for the result sets (optional).protected QueryResultMetaData[]resultMetaDatasMetaData defining the results of the query (optional).protected intresultSetNumberprotected Set<AbstractStoredProcedureQuery.StoredProcedureParameter>storedProcParams-
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
Constructors Constructor Description AbstractStoredProcedureQuery(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetLanguage()Accessor for the query language.abstract ObjectgetNextResults()Accessor for the next result set.ObjectgetOutputParameterValue(int pos)Accessor for the value of the output parameter at the specified position.ObjectgetOutputParameterValue(String name)Accessor for the value of the output parameter with the specified name.abstract intgetUpdateCount()Accessor for the update count.abstract booleanhasMoreResults()Accessor for whether there are more results after the current one.voidregisterParameter(int pos, Class type, StoredProcQueryParameterMode mode)voidregisterParameter(String name, Class type, StoredProcQueryParameterMode mode)voidsetCandidates(Collection pcs)Set the candidate Collection to query.voidsetCandidates(Extent pcs)Set the candidate Extent to query.voidsetResultClasses(Class[] resultClasses)Set the result class for the results.voidsetResultMetaData(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 Detail
-
procedureName
protected String procedureName
-
storedProcParams
protected Set<AbstractStoredProcedureQuery.StoredProcedureParameter> storedProcParams
-
resultSetNumber
protected int resultSetNumber
-
resultMetaDatas
protected QueryResultMetaData[] resultMetaDatas
MetaData defining the results of the query (optional).
-
resultClasses
protected Class[] resultClasses
Result classes for the result sets (optional).
-
outputParamValues
protected Map outputParamValues
Repository for holding output parameter values after execution.
-
-
Constructor Detail
-
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
public AbstractStoredProcedureQuery(StoreManager storeMgr, ExecutionContext ec, String procName)
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 Detail
-
getLanguage
public String getLanguage()
Description copied from class:QueryAccessor for the query language.- Overrides:
getLanguagein classQuery- Returns:
- Query language
-
setCandidates
public void setCandidates(Extent pcs)
Description copied from class:QuerySet the candidate Extent to query. To be implemented by extensions.- Specified by:
setCandidatesin classQuery- Parameters:
pcs- the Candidate Extent.
-
setCandidates
public void setCandidates(Collection pcs)
Description copied from class:QuerySet the candidate Collection to query. To be implemented by extensions.- Specified by:
setCandidatesin classQuery- Parameters:
pcs- the Candidate collection.
-
setResultMetaData
public void setResultMetaData(QueryResultMetaData[] qrmds)
Method to set the MetaData defining the result. Setting this will unset the resultClass.- Parameters:
qrmds- Query Result MetaData
-
setResultClasses
public void setResultClasses(Class[] resultClasses)
Set the result class for the results. Setting this will unset the resultMetaData.- Parameters:
resultClasses- The result class
-
registerParameter
public void registerParameter(int pos, Class type, StoredProcQueryParameterMode mode)
-
registerParameter
public void registerParameter(String name, Class type, StoredProcQueryParameterMode mode)
-
hasMoreResults
public abstract boolean hasMoreResults()
Accessor for whether there are more results after the current one.- Returns:
- Whether there are more results
-
getNextResults
public abstract Object getNextResults()
Accessor for the next result set.- Returns:
- Next results
-
getUpdateCount
public abstract int getUpdateCount()
Accessor for the update count.- Returns:
- Update count
-
getOutputParameterValue
public Object getOutputParameterValue(int pos)
Accessor for the value of the output parameter at the specified position. Only to be called after execute().- Parameters:
pos- Position- Returns:
- The value
-
-