Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class CreateViewNode

extends DDLStatementNode
Class Inheritance
Imports
org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.Limits, .SQLState, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.CompilerContext, .OptimizerFactory, .Visitor, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, org.apache.derby.iapi.sql.depend.DependencyManager, .ProviderInfo, .ProviderList, org.apache.derby.iapi.sql.dictionary.DataDictionary, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.impl.sql.execute.ColumnInfo

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

Field Summary

Modifier and TypeField and Description
private int
private ColumnInfo[]
private ValueNode
private boolean
private ValueNode
private OrderByList
private ProviderInfo[]
private String
private ResultSetNode
private ResultColumnList
Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
ADD_TYPEDROP_STATISTICSDROP_TYPEimplicitCreateSchemaLOCKING_TYPEMODIFY_TYPEUNKNOWN_TYPEUPDATE_STATISTICS

Constructor Summary

AccessConstructor and Description
pack-priv
CreateViewNode(TableName
The name of the table to be created
viewName
,
ResultColumnList
The column list from the view definition, if specified
resultColumns
,
ResultSetNode
The query expression for the view
queryExpression
,
int
The type of WITH CHECK OPTION that was specified (NONE for now)
checkOption
,
String
The text for the queryExpression
qeText
,
OrderByList
ORDER BY list
orderCols
,
ValueNode
OFFSET if any, or null
offset
,
ValueNode
FETCH FIRST if any, or null
fetchFirst
,
boolean
True if the offset/fetchFirst clauses come from JDBC limit/offset escape syntax
hasJDBClimitClause
,
ContextManager
Context manager
cm
)

Constructor for a CreateViewNode

Method Summary

Modifier and TypeMethod and Description
pack-priv void
acceptChildren(Visitor
the visitor
v
)

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.acceptChildren.

Accept the visitor for all visitable children of this node.

public void
private ProviderInfo[]

Returns:

Array of providers that this view depends on.
bindViewDefinition
(DataDictionary
The DataDictionary to use to look up columns, tables, etc.
dataDictionary
,
CompilerContext compilerContext, LanguageConnectionContext lcc, OptimizerFactory optimizerFactory, ResultSetNode queryExpr, ContextManager cm)

Bind the query expression for a view definition.

private void
genColumnInfos(ColumnInfo[]
The ColumnInfo[] to be filled in.
colInfos
)

Fill in the ColumnInfo[] for this create view.

public ValueNode
public ValueNode
public OrderByList
pack-priv ResultSetNode

Returns:

the parsed query expression.
getParsedQueryExpression
()

Get the parsed query expression (the SELECT statement).

public boolean
public ConstantAction
makeConstantAction()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

pack-priv void
printSubNodes(int
The depth of this node in the tree
depth
)

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.printSubNodes.

Prints the sub-nodes of this object.

public boolean

Returns:

true if references SESSION schema tables, else false
referencesSessionSchema
()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

pack-priv String
public String

Returns:

This object as a String
toString
()

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.toString.

Convert this object to a String.

Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
activationKindgenerategetFullNamegetObjectNamegetRelativeNamegetSchemaDescriptorgetSchemaDescriptorgetTableDescriptorgetTableDescriptorgetTableDescriptorgetTableDescriptorinitAndCheckisAtomicmakeFromList

Field Detail

checkOptionback to summary
private int checkOption
colInfosback to summary
private ColumnInfo[] colInfos
fetchFirstback to summary
private ValueNode fetchFirst
hasJDBClimitClauseback to summary
private boolean hasJDBClimitClause
offsetback to summary
private ValueNode offset
orderByListback to summary
private OrderByList orderByList
providerInfosback to summary
private ProviderInfo[] providerInfos
qeTextback to summary
private String qeText
queryExpressionback to summary
private ResultSetNode queryExpression
resultColumnsback to summary
private ResultColumnList resultColumns

Constructor Detail

CreateViewNodeback to summary
pack-priv 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:TableName

The name of the table to be created

resultColumns:ResultColumnList

The column list from the view definition, if specified

queryExpression:ResultSetNode

The query expression for the view

checkOption:int

The type of WITH CHECK OPTION that was specified (NONE for now)

qeText:String

The text for the queryExpression

orderCols:OrderByList

ORDER BY list

offset:ValueNode

OFFSET if any, or null

fetchFirst:ValueNode

FETCH FIRST if any, or null

hasJDBClimitClause:boolean

True if the offset/fetchFirst clauses come from JDBC limit/offset escape syntax

cm:ContextManager

Context manager

Exceptions
StandardException:
Thrown on error

Method Detail

acceptChildrenback to summary
pack-priv void acceptChildren(Visitor v) throws StandardException

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.acceptChildren.

Accept the visitor for all visitable children of this node.

Parameters
v:Visitor

the visitor

Annotations
@Override
Exceptions
StandardException:
on error
bindStatementback to summary
public void bindStatement() throws StandardException

Overrides org.apache.derby.impl.sql.compile.StatementNode.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.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
bindViewDefinitionback to summary
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:DataDictionary

The DataDictionary to use to look up columns, tables, etc.

Returns:ProviderInfo[]

Array of providers that this view depends on.

Exceptions
StandardException:
Thrown on error
genColumnInfosback to summary
private void genColumnInfos(ColumnInfo[] colInfos)

Fill in the ColumnInfo[] for this create view.

Parameters
colInfos:ColumnInfo[]

The ColumnInfo[] to be filled in.

getFetchFirstback to summary
public ValueNode getFetchFirst()
getOffsetback to summary
public ValueNode getOffset()
getOrderByListback to summary
public OrderByList getOrderByList()
getParsedQueryExpressionback to summary
pack-priv ResultSetNode getParsedQueryExpression()

Get the parsed query expression (the SELECT statement).

Returns:ResultSetNode

the parsed query expression.

hasJDBClimitClauseback to summary
public boolean hasJDBClimitClause()
makeConstantActionback to summary
public ConstantAction makeConstantAction() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

Annotations
@Override
Exceptions
StandardException:
Thrown on failure
printSubNodesback to summary
pack-priv void printSubNodes(int depth)

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.printSubNodes.

Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Parameters
depth:int

The depth of this node in the tree

Annotations
@Override
referencesSessionSchemaback to summary
public boolean referencesSessionSchema() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

Returns:boolean

true if references SESSION schema tables, else false

Annotations
@Override
Exceptions
StandardException:
Thrown on error
statementToStringback to summary
pack-priv String statementToString()

Implements abstract org.apache.derby.impl.sql.compile.StatementNode.statementToString.

toStringback to summary
public String toString()

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.toString.

Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Returns:String

This object as a String

Annotations
@Override