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

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.StatementNode
          extended byorg.apache.derby.impl.sql.compile.DDLStatementNode
              extended byorg.apache.derby.impl.sql.compile.CreateStatementNode
                  extended byorg.apache.derby.impl.sql.compile.CreateTableNode
All Implemented Interfaces:
Visitable

public class CreateTableNode
extends CreateStatementNode

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

Author:
Jeff Lichtman

Field Summary
private  char lockGranularity
           
private  boolean onCommitDeleteRows
           
private  boolean onRollbackDeleteRows
           
private  java.util.Properties properties
           
private  TableElementList tableElementList
           
protected  int tableType
           
 
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_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset
 
Constructor Summary
CreateTableNode()
           
 
Method Summary
 QueryTreeNode bind()
          Bind this CreateTableNode.
 void init(java.lang.Object newObjectName, java.lang.Object tableElementList, java.lang.Object properties, java.lang.Object lockGranularity)
          Initializer for a CreateTableNode for a base table
 void init(java.lang.Object newObjectName, java.lang.Object tableElementList, java.lang.Object properties, java.lang.Object onCommitDeleteRows, java.lang.Object onRollbackDeleteRows)
          Initializer for a CreateTableNode for a global temporary table
 ConstantAction makeConstantAction()
          Create the Constant information that will drive the guts of Execution.
 boolean referencesSessionSchema()
          Return true if the node references SESSION schema tables (temporary or permanent)
 java.lang.String statementToString()
           
private  java.lang.Object tempTableSchemaNameCheck(java.lang.Object objectName)
          If no schema name specified for global temporary table, SESSION is the implicit schema.
 java.lang.String toString()
          Convert this object to a String.
 
Methods inherited from class org.apache.derby.impl.sql.compile.CreateStatementNode
alterItem, isCreate
 
Methods inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode
activationKind, bindName, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, init, initAndCheck, isAtomic
 
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode
generate, lockTableForCompilation
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, isSessionSchema, isSessionSchema, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, printSubNodes, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lockGranularity

private char lockGranularity

onCommitDeleteRows

private boolean onCommitDeleteRows

onRollbackDeleteRows

private boolean onRollbackDeleteRows

properties

private java.util.Properties properties

tableElementList

private TableElementList tableElementList

tableType

protected int tableType
Constructor Detail

CreateTableNode

public CreateTableNode()
Method Detail

init

public void init(java.lang.Object newObjectName,
                 java.lang.Object tableElementList,
                 java.lang.Object properties,
                 java.lang.Object lockGranularity)
          throws StandardException
Initializer for a CreateTableNode for a base table

Overrides:
init in class QueryTreeNode
Parameters:
tableElementList - The elements of the table: columns, constraints, etc.
properties - The optional list of properties associated with the table.
lockGranularity - The lock granularity.
Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object newObjectName,
                 java.lang.Object tableElementList,
                 java.lang.Object properties,
                 java.lang.Object onCommitDeleteRows,
                 java.lang.Object onRollbackDeleteRows)
          throws StandardException
Initializer for a CreateTableNode for a global temporary table

Overrides:
init in class QueryTreeNode
Parameters:
tableElementList - The elements of the table: columns, constraints, etc.
properties - The optional list of properties associated with the table.
onCommitDeleteRows - If true, on commit delete rows else on commit preserve rows of temporary table.
onRollbackDeleteRows - If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value
Throws:
StandardException - Thrown on error

tempTableSchemaNameCheck

private java.lang.Object tempTableSchemaNameCheck(java.lang.Object objectName)
                                           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:
objectName - The name of the new object being declared (ie temporary table)
Throws:
StandardException

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

bind

public QueryTreeNode bind()
                   throws StandardException
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.

Overrides:
bind in class QueryTreeNode
Returns:
The bound query tree
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

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.