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

pack-priv Class CreateTableNode

extends DDLStatementNode
Class Inheritance
Imports
java.util.Properties, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.Limits, .Property, .SQLState, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.CompilerContext, .Visitor, org.apache.derby.iapi.sql.conn.Authorizer, org.apache.derby.iapi.sql.depend.ProviderList, org.apache.derby.iapi.sql.dictionary.DataDictionary, .SchemaDescriptor, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.types.DataTypeDescriptor, org.apache.derby.impl.sql.execute.ColumnInfo, .CreateConstraintConstantAction

A CreateTableNode is the root of a QueryTree that represents a CREATE TABLE or DECLARE GLOBAL TEMPORARY TABLE statement.

Field Summary

Modifier and TypeField and Description
private char
private boolean
private boolean
private Properties
private ResultSetNode
private ResultColumnList
private TableElementList
protected int
Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
ADD_TYPEDROP_STATISTICSDROP_TYPEimplicitCreateSchemaLOCKING_TYPEMODIFY_TYPEUNKNOWN_TYPEUPDATE_STATISTICS

Constructor Summary

AccessConstructor and Description
pack-priv
CreateTableNode(TableName
The name of the new object being created (ie base table)
tableName
,
TableElementList
The elements of the table: columns, constraints, etc.
tableElementList
,
Properties
The optional list of properties associated with the table.
properties
,
char
The lock granularity.
lockGranularity
,
ContextManager
The context manager
cm
)

Constructor for a CreateTableNode for a base table

pack-priv
CreateTableNode(TableName
The name of the new object being declared (ie temporary table)
tableName
,
TableElementList
The elements of the table: columns, constraints, etc.
tableElementList
,
Properties
The optional list of properties associated with the table.
properties
,
boolean
If true, on commit delete rows else on commit preserve rows of temporary table.
onCommitDeleteRows
,
boolean
If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value
onRollbackDeleteRows
,
ContextManager cm)

Constructor for a CreateTableNode for a global temporary table

pack-priv
CreateTableNode(TableName
The name of the new object being created (ie base table).
tableName
,
ResultColumnList
The optional column list.
resultColumns
,
ResultSetNode
The query expression for the table.
queryExpression
,
ContextManager
The context manager
cm
)

Constructor for a CreateTableNode for a base table create from a query

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
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 to indent the sub-nodes
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
private static TableName
tempTableSchemaNameCheck(TableName
The name of the new object being declared (ie temporary table)
tableName
)

If no schema name specified for global temporary table, SESSION is the implicit schema.

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

lockGranularityback to summary
private char lockGranularity
onCommitDeleteRowsback to summary
private boolean onCommitDeleteRows
onRollbackDeleteRowsback to summary
private boolean onRollbackDeleteRows
propertiesback to summary
private Properties properties
queryExpressionback to summary
private ResultSetNode queryExpression
resultColumnsback to summary
private ResultColumnList resultColumns
tableElementListback to summary
private TableElementList tableElementList
tableTypeback to summary
protected int tableType

Constructor Detail

CreateTableNodeback to summary
pack-priv CreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, char lockGranularity, ContextManager cm) throws StandardException

Constructor for a CreateTableNode for a base table

Parameters
tableName:TableName

The name of the new object being created (ie base table)

tableElementList:TableElementList

The elements of the table: columns, constraints, etc.

properties:Properties

The optional list of properties associated with the table.

lockGranularity:char

The lock granularity.

cm:ContextManager

The context manager

Exceptions
StandardException:
Thrown on error
CreateTableNodeback to summary
pack-priv CreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, boolean onCommitDeleteRows, boolean onRollbackDeleteRows, ContextManager cm) throws StandardException

Constructor for a CreateTableNode for a global temporary table

Parameters
tableName:TableName

The name of the new object being declared (ie temporary table)

tableElementList:TableElementList

The elements of the table: columns, constraints, etc.

properties:Properties

The optional list of properties associated with the table.

onCommitDeleteRows:boolean

If true, on commit delete rows else on commit preserve rows of temporary table.

onRollbackDeleteRows:boolean

If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value

Exceptions
StandardException:
Thrown on error
CreateTableNodeback to summary
pack-priv CreateTableNode(TableName tableName, ResultColumnList resultColumns, ResultSetNode queryExpression, ContextManager cm) throws StandardException

Constructor for a CreateTableNode for a base table create from a query

Parameters
tableName:TableName

The name of the new object being created (ie base table).

resultColumns:ResultColumnList

The optional column list.

queryExpression:ResultSetNode

The query expression for the table.

cm:ContextManager

The context manager

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 CreateTableNode. This means doing any static error checking that can be done before actually creating the base table or declaring the global temporary table. For eg, verifying that the TableElementList does not contain any duplicate column names.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
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 to indent the sub-nodes

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.

tempTableSchemaNameCheckback to summary
private static TableName tempTableSchemaNameCheck(TableName tableName) throws StandardException

If no schema name specified for global temporary table, SESSION is the implicit schema. Otherwise, make sure the specified schema name for global temporary table is SESSION.

Parameters
tableName:TableName

The name of the new object being declared (ie temporary table)

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