org.apache.derby.impl.sql.compile
Class CreateViewNode

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.QueryTreeNode
      extended by org.apache.derby.impl.sql.compile.StatementNode
          extended by org.apache.derby.impl.sql.compile.DDLStatementNode
              extended by org.apache.derby.impl.sql.compile.CreateViewNode
All Implemented Interfaces:
Visitable

public class CreateViewNode
extends DDLStatementNode

A CreateViewNode is the root of a QueryTree that represents a CREATE VIEW statement.


Field Summary
(package private)  int checkOption
           
(package private)  ColumnInfo[] colInfos
           
private  ValueNode fetchFirst
           
private  ValueNode offset
           
private  OrderByList orderByList
           
(package private)  ProviderInfo[] providerInfos
           
(package private)  java.lang.String qeText
           
(package private)  ResultSetNode queryExpression
           
(package private)  ResultColumnList resultColumns
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode
ADD_TYPE, DROP_TYPE, implicitCreateSchema, LOCKING_TYPE, MODIFY_TYPE, UNKNOWN_TYPE
 
Fields inherited from class org.apache.derby.impl.sql.compile.StatementNode
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_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired
 
Constructor Summary
CreateViewNode()
           
 
Method Summary
(package private)  void acceptChildren(Visitor v)
          Accept the visitor for all visitable children of this node.
 void bindStatement()
          Bind this CreateViewNode.
private  ProviderInfo[] bindViewDefinition(DataDictionary dataDictionary, CompilerContext compilerContext, LanguageConnectionContext lcc, NodeFactory nodeFactory, ResultSetNode queryExpr, ContextManager cm)
          Bind the query expression for a view definition.
private  void genColumnInfos(ColumnInfo[] colInfos)
          Fill in the ColumnInfo[] for this create view.
 int getCheckOption()
           
 ColumnInfo[] getColumnInfo()
           
 ValueNode getFetchFirst()
           
 ValueNode getOffset()
           
 OrderByList getOrderByList()
           
(package private)  ResultSetNode getParsedQueryExpression()
          Get the parsed query expression (the SELECT statement).
 ProviderInfo[] getProviderInfo()
           
 void init(java.lang.Object newObjectName, java.lang.Object resultColumns, java.lang.Object queryExpression, java.lang.Object checkOption, java.lang.Object qeText, java.lang.Object orderCols, java.lang.Object offset, java.lang.Object fetchFirst)
          Initializer for a CreateViewNode
 ConstantAction makeConstantAction()
          Create the Constant information that will drive the guts of Execution.
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 boolean referencesSessionSchema()
          Return true if the node references SESSION schema tables (temporary or permanent)
 java.lang.String statementToString()
           
 java.lang.String toString()
          Convert this object to a String.
 
Methods inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode
activationKind, bindName, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, init, initAndCheck, isAtomic, makeFromList
 
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode
executeSchemaName, executeStatementName, generate, getSPSName, lockTableForCompilation, makeResultDescription, needsSavepoint, optimizeStatement
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, bindOffsetFetch, bindRowMultiSet, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resultColumns

ResultColumnList resultColumns

queryExpression

ResultSetNode queryExpression

qeText

java.lang.String qeText

checkOption

int checkOption

providerInfos

ProviderInfo[] providerInfos

colInfos

ColumnInfo[] colInfos

orderByList

private OrderByList orderByList

offset

private ValueNode offset

fetchFirst

private ValueNode fetchFirst
Constructor Detail

CreateViewNode

public CreateViewNode()
Method Detail

init

public void init(java.lang.Object newObjectName,
                 java.lang.Object resultColumns,
                 java.lang.Object queryExpression,
                 java.lang.Object checkOption,
                 java.lang.Object qeText,
                 java.lang.Object orderCols,
                 java.lang.Object offset,
                 java.lang.Object fetchFirst)
          throws StandardException
Initializer for a CreateViewNode

Overrides:
init in class QueryTreeNode
Parameters:
newObjectName - The name of the table to be created
resultColumns - The column list from the view definition, if specified
queryExpression - The query expression for the view
checkOption - The type of WITH CHECK OPTION that was specified (NONE for now)
qeText - The text for the queryExpression
orderCols - ORDER BY list
offset - OFFSET if any, or null
fetchFirst - FETCH FIRST if any, or null
Throws:
StandardException - Thrown on error

toString

public java.lang.String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class DDLStatementNode
Returns:
This object as a String

statementToString

public java.lang.String statementToString()
Specified by:
statementToString in class StatementNode

printSubNodes

public void printSubNodes(int depth)
Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Overrides:
printSubNodes in class QueryTreeNode
Parameters:
depth - The depth of this node in the tree

getCheckOption

public int getCheckOption()

getProviderInfo

public ProviderInfo[] getProviderInfo()

getColumnInfo

public ColumnInfo[] getColumnInfo()

bindStatement

public void bindStatement()
                   throws StandardException
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:
bindStatement in class StatementNode
Throws:
StandardException - Thrown on error

bindViewDefinition

private ProviderInfo[] bindViewDefinition(DataDictionary dataDictionary,
                                          CompilerContext compilerContext,
                                          LanguageConnectionContext lcc,
                                          NodeFactory nodeFactory,
                                          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

public boolean referencesSessionSchema()
                                throws StandardException
Return true if the node references SESSION schema tables (temporary or permanent)

Overrides:
referencesSessionSchema in class QueryTreeNode
Returns:
true if references SESSION schema tables, else false
Throws:
StandardException - Thrown on error

makeConstantAction

public ConstantAction makeConstantAction()
                                  throws StandardException
Create the Constant information that will drive the guts of Execution.

Overrides:
makeConstantAction in class QueryTreeNode
Throws:
StandardException - Thrown on failure

genColumnInfos

private void genColumnInfos(ColumnInfo[] colInfos)
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

void acceptChildren(Visitor v)
              throws StandardException
Accept the visitor for all visitable children of this node.

Overrides:
acceptChildren in class QueryTreeNode
Parameters:
v - the visitor
Throws:
StandardException - on error

getOrderByList

public OrderByList getOrderByList()

getOffset

public ValueNode getOffset()

getFetchFirst

public ValueNode getFetchFirst()

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.