Class ExecSPSNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.StatementNode
org.apache.derby.impl.sql.compile.ExecSPSNode
- All Implemented Interfaces:
Visitable
A ExecSPSNode is the root of a QueryTree
that represents an EXECUTE STATEMENT
statement. It is a tad abnormal. During a
bind, it locates and retrieves the SPSDescriptor
for the particular statement. At generate time,
it generates the prepared statement for the
stored prepared statement and returns it (i.e.
it effectively replaces itself with the appropriate
prepared statement).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TableName
private ExecPreparedStatement
private SPSDescriptor
Fields inherited from class org.apache.derby.impl.sql.compile.StatementNode
EMPTY_TD_LIST, NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATION
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
-
Constructor Summary
ConstructorsConstructorDescriptionExecSPSNode
(TableName newObjectName, ContextManager cm) Constructor for a ExecSPSNode -
Method Summary
Modifier and TypeMethodDescription(package private) void
Accept a visitor on all child nodes.(package private) int
void
Bind this ExecSPSNode.Returns name of schema in EXECUTE STATEMENT command.Returns the name of statement in EXECUTE STATEMENT command.Do code generation for this statement.Get information about this cursor.Return a description of the ?Get the name of the SPS that is used to execute this statement.boolean
isAtomic()
SPSes are atomic if its underlying statement is atomic.Create the Constant information that will drive the guts of Execution.Make the result description.boolean
We need a savepoint if we will do transactional work.(package private) String
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode
lockTableForCompilation, optimizeStatement, toString, updateIndexStatisticsFor
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
-
Field Details
-
name
-
spsd
-
ps
-
-
Constructor Details
-
ExecSPSNode
ExecSPSNode(TableName newObjectName, ContextManager cm) Constructor for a ExecSPSNode- Parameters:
newObjectName
- The name of the table to be createdcm
- The context manager- Throws:
StandardException
- Thrown on error
-
-
Method Details
-
bindStatement
Bind this ExecSPSNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the ResultColumnList does not contain any duplicate column names.- Overrides:
bindStatement
in classStatementNode
- Throws:
StandardException
- Thrown on error
-
isAtomic
public boolean isAtomic()SPSes are atomic if its underlying statement is atomic.- Overrides:
isAtomic
in classStatementNode
- Returns:
- true if the statement is atomic
-
generate
Do code generation for this statement. Overrides the normal generation path in StatementNode.- Overrides:
generate
in classStatementNode
- Parameters:
ignored
- - ignored (he he)- Returns:
- A GeneratedClass for this statement
- Throws:
StandardException
- Thrown on error
-
makeResultDescription
Make the result description. Really, we are just copying it from the stored prepared statement.- Overrides:
makeResultDescription
in classStatementNode
- Returns:
- the description
-
getCursorInfo
Get information about this cursor. For sps, this is info saved off of the original query tree (the one for the underlying query).- Overrides:
getCursorInfo
in classStatementNode
- Returns:
- the cursor info
-
getParameterTypes
Return a description of the ? parameters for the statement represented by this query tree. Just return the params stored with the prepared statement.- Overrides:
getParameterTypes
in classQueryTreeNode
- Returns:
- An array of DataTypeDescriptors describing the ? parameters for this statement. It returns null if there are no parameters.
- Throws:
StandardException
- on error
-
makeConstantAction
Create the Constant information that will drive the guts of Execution. This is assumed to be the first action on this node.- Overrides:
makeConstantAction
in classQueryTreeNode
-
needsSavepoint
public boolean needsSavepoint()We need a savepoint if we will do transactional work. We'll ask the underlying statement if it needs a savepoint and pass that back. We have to do this after generation because getting the PS now might cause us to basically do DDL (for a stmt recompilation) which is explicitly banned during binding. So the caller can only call this after generate() has retrieved the target PS.- Overrides:
needsSavepoint
in classStatementNode
- Returns:
- boolean always true.
-
executeStatementName
Description copied from class:StatementNode
Returns the name of statement in EXECUTE STATEMENT command. Returns null for all other commands.- Overrides:
executeStatementName
in classStatementNode
- Returns:
- String null unless overridden for Execute Statement command
- See Also:
-
executeSchemaName
Description copied from class:StatementNode
Returns name of schema in EXECUTE STATEMENT command. Returns null for all other commands.- Overrides:
executeSchemaName
in classStatementNode
- Returns:
- String schema for EXECUTE STATEMENT null for all others
- See Also:
-
getSPSName
Get the name of the SPS that is used to execute this statement. Only relevant for an ExecSPSNode -- otherwise, returns null.- Overrides:
getSPSName
in classStatementNode
- Returns:
- the name of the underlying sps
-
activationKind
int activationKind()- Specified by:
activationKind
in classStatementNode
-
statementToString
String statementToString()- Specified by:
statementToString
in classStatementNode
-
acceptChildren
Description copied from class:QueryTreeNode
Accept a visitor on all child nodes. All sub-classes that add fields that should be visited, should override this method and callaccept(v)
on all visitable fields, as well assuper.acceptChildren(v)
to make sure all visitable fields defined by the super-class are accepted too.- Overrides:
acceptChildren
in classQueryTreeNode
- Parameters:
v
- the visitor- Throws:
StandardException
- on errors raised by the visitor
-