Class CreateViewNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.StatementNode
org.apache.derby.impl.sql.compile.DDLStatementNode
org.apache.derby.impl.sql.compile.CreateViewNode
- All Implemented Interfaces:
Visitable
A CreateViewNode is the root of a QueryTree that represents a CREATE VIEW
statement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate ColumnInfo[]private ValueNodeprivate booleanprivate ValueNodeprivate OrderByListprivate ProviderInfo[]private Stringprivate ResultSetNodeprivate ResultColumnListFields inherited from class DDLStatementNode
ADD_TYPE, DROP_STATISTICS, DROP_TYPE, implicitCreateSchema, LOCKING_TYPE, MODIFY_TYPE, UNKNOWN_TYPE, UPDATE_STATISTICSFields inherited from class StatementNode
EMPTY_TD_LIST, NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATIONFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionCreateViewNode(TableName viewName, ResultColumnList resultColumns, ResultSetNode queryExpression, int checkOption, String qeText, OrderByList orderCols, ValueNode offset, ValueNode fetchFirst, boolean hasJDBClimitClause, ContextManager cm) Constructor for a CreateViewNode -
Method Summary
Modifier and TypeMethodDescription(package private) voidAccept the visitor for all visitable children of this node.voidBind this CreateViewNode.private ProviderInfo[]bindViewDefinition(DataDictionary dataDictionary, CompilerContext compilerContext, LanguageConnectionContext lcc, OptimizerFactory optimizerFactory, ResultSetNode queryExpr, ContextManager cm) Bind the query expression for a view definition.private voidgenColumnInfos(ColumnInfo[] colInfos) Fill in the ColumnInfo[] for this create view.(package private) ResultSetNodeGet the parsed query expression (the SELECT statement).booleanCreate the Constant information that will drive the guts of Execution.(package private) voidprintSubNodes(int depth) Prints the sub-nodes of this object.booleanReturn true if the node references SESSION schema tables (temporary or permanent)(package private) StringtoString()Convert this object to a String.Methods inherited from class DDLStatementNode
activationKind, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, initAndCheck, isAtomic, makeFromListMethods inherited from class StatementNode
executeSchemaName, executeStatementName, generate, getCursorInfo, getSPSName, lockTableForCompilation, makeResultDescription, needsSavepoint, optimizeStatement, updateIndexStatisticsForMethods inherited from class QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
-
Field Details
-
resultColumns
-
queryExpression
-
qeText
-
checkOption
private int checkOption -
providerInfos
-
colInfos
-
orderByList
-
offset
-
fetchFirst
-
hasJDBClimitClause
private boolean hasJDBClimitClause
-
-
Constructor Details
-
CreateViewNode
CreateViewNode(TableName viewName, ResultColumnList resultColumns, ResultSetNode queryExpression, int checkOption, String qeText, OrderByList orderCols, ValueNode offset, ValueNode fetchFirst, boolean hasJDBClimitClause, ContextManager cm) throws StandardException Constructor for a CreateViewNode- Parameters:
viewName- The name of the table to be createdresultColumns- The column list from the view definition, if specifiedqueryExpression- The query expression for the viewcheckOption- The type of WITH CHECK OPTION that was specified (NONE for now)qeText- The text for the queryExpressionorderCols- ORDER BY listoffset- OFFSET if any, or nullfetchFirst- FETCH FIRST if any, or nullhasJDBClimitClause- True if the offset/fetchFirst clauses come from JDBC limit/offset escape syntaxcm- Context manager- Throws:
StandardException- Thrown on error
-
-
Method Details
-
toString
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.- Overrides:
toStringin classDDLStatementNode- Returns:
- This object as a String
-
statementToString
String statementToString()- Specified by:
statementToStringin classStatementNode
-
printSubNodes
void printSubNodes(int depth) Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.- Overrides:
printSubNodesin classQueryTreeNode- Parameters:
depth- The depth of this node in the tree
-
bindStatement
Bind this CreateViewNode. 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:
bindStatementin classStatementNode- Throws:
StandardException- Thrown on error
-
bindViewDefinition
private ProviderInfo[] bindViewDefinition(DataDictionary dataDictionary, CompilerContext compilerContext, LanguageConnectionContext lcc, OptimizerFactory optimizerFactory, ResultSetNode queryExpr, ContextManager cm) throws StandardException Bind the query expression for a view definition.- Parameters:
dataDictionary- The DataDictionary to use to look up columns, tables, etc.- Returns:
- Array of providers that this view depends on.
- Throws:
StandardException- Thrown on error
-
referencesSessionSchema
Return true if the node references SESSION schema tables (temporary or permanent)- Overrides:
referencesSessionSchemain classQueryTreeNode- Returns:
- true if references SESSION schema tables, else false
- Throws:
StandardException- Thrown on error
-
makeConstantAction
Create the Constant information that will drive the guts of Execution.- Overrides:
makeConstantActionin classQueryTreeNode- Throws:
StandardException- Thrown on failure
-
genColumnInfos
Fill in the ColumnInfo[] for this create view.- Parameters:
colInfos- The ColumnInfo[] to be filled in.
-
getParsedQueryExpression
ResultSetNode getParsedQueryExpression()Get the parsed query expression (the SELECT statement).- Returns:
- the parsed query expression.
-
acceptChildren
Accept the visitor for all visitable children of this node.- Overrides:
acceptChildrenin classDDLStatementNode- Parameters:
v- the visitor- Throws:
StandardException- on error
-
getOrderByList
-
getOffset
-
getFetchFirst
-
hasJDBClimitClause
public boolean hasJDBClimitClause()
-