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

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.AlterTableNode
All Implemented Interfaces:
Visitable

public class AlterTableNode
extends DDLStatementNode

A AlterTableNode represents a DDL statement that alters a table. It contains the name of the object to be created.

Author:
Jerry Brenner

Field Summary
 TableDescriptor baseTable
           
 int behavior
           
private  int changeType
           
protected  ColumnInfo[] colInfos
           
 boolean compressTable
           
protected  ConstraintConstantAction[] conActions
           
 char lockGranularity
           
protected  int numConstraints
           
protected  SchemaDescriptor schemaDescriptor
           
 boolean sequential
           
 TableElementList tableElementList
           
private  boolean truncateTable
           
 
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
AlterTableNode()
           
 
Method Summary
 QueryTreeNode bind()
          Bind this AlterTableNode.
 void genColumnInfo()
          Generate the ColumnInfo argument for the constant action.
 int getChangeType()
           
 void init(java.lang.Object objectName)
          Initializer for a TRUNCATE TABLE
 void init(java.lang.Object objectName, java.lang.Object sequential)
          Initializer for a AlterTableNode for COMPRESS
 void init(java.lang.Object objectName, java.lang.Object tableElementList, java.lang.Object lockGranularity, java.lang.Object changeType, java.lang.Object behavior, java.lang.Object sequential)
          Initializer for a AlterTableNode
 ConstantAction makeConstantAction()
          Create the Constant information that will drive the guts of Execution.
 void prepConstantAction()
          Generate arguments to constant action.
 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, getTableDescriptor, getTableDescriptor, getTableDescriptor, 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

tableElementList

public TableElementList tableElementList

lockGranularity

public char lockGranularity

compressTable

public boolean compressTable

sequential

public boolean sequential

behavior

public int behavior

baseTable

public TableDescriptor baseTable

numConstraints

protected int numConstraints

changeType

private int changeType

truncateTable

private boolean truncateTable

schemaDescriptor

protected SchemaDescriptor schemaDescriptor

colInfos

protected ColumnInfo[] colInfos

conActions

protected ConstraintConstantAction[] conActions
Constructor Detail

AlterTableNode

public AlterTableNode()
Method Detail

init

public void init(java.lang.Object objectName)
          throws StandardException
Initializer for a TRUNCATE TABLE

Overrides:
init in class DDLStatementNode
Parameters:
objectName - The name of the table being truncated
Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object objectName,
                 java.lang.Object sequential)
          throws StandardException
Initializer for a AlterTableNode for COMPRESS

Overrides:
init in class QueryTreeNode
Parameters:
objectName - The name of the table being altered
sequential - Whether or not the COMPRESS is SEQUENTIAL
Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object objectName,
                 java.lang.Object tableElementList,
                 java.lang.Object lockGranularity,
                 java.lang.Object changeType,
                 java.lang.Object behavior,
                 java.lang.Object sequential)
          throws StandardException
Initializer for a AlterTableNode

Overrides:
init in class QueryTreeNode
Parameters:
objectName - The name of the table being altered
tableElementList - The alter table action
lockGranularity - The new lock granularity, if any
changeType - ADD_TYPE or DROP_TYPE
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

getChangeType

public int getChangeType()

bind

public QueryTreeNode bind()
                   throws StandardException
Bind this AlterTableNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the user is not trying to add a non-nullable column.

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

prepConstantAction

public void prepConstantAction()
                        throws StandardException
Generate arguments to constant action. Called by makeConstantAction() in this class and in our subclass RepAlterTableNode.

Throws:
StandardException - Thrown on failure

genColumnInfo

public void genColumnInfo()
Generate the ColumnInfo argument for the constant action. Return the number of constraints.

Returns:
number of constraints

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

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