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

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

public class CreateIndexNode
extends DDLStatementNode

A CreateIndexNode is the root of a QueryTree that represents a CREATE INDEX statement.


Field Summary
(package private)  int[] boundColumnIDs
           
(package private)  java.util.Vector columnNameList
           
(package private)  java.lang.String[] columnNames
           
(package private)  DataDictionary dd
           
(package private)  TableName indexName
           
(package private)  java.lang.String indexType
           
(package private)  boolean[] isAscending
           
(package private)  java.util.Properties properties
           
(package private)  TableName tableName
           
(package private)  TableDescriptor td
           
(package private)  boolean unique
           
 
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
CreateIndexNode()
           
 
Method Summary
 void bindStatement()
          Bind this CreateIndexNode.
 UUID getBoundTableID()
           
 java.lang.String[] getColumnNames()
           
 TableName getIndexName()
           
 TableName getIndexTableName()
           
 java.lang.String getIndexType()
           
 boolean[] getIsAscending()
           
 int[] getKeyColumnIDs()
           
 java.util.Properties getProperties()
           
 boolean getUniqueness()
           
 void init(java.lang.Object unique, java.lang.Object indexType, java.lang.Object indexName, java.lang.Object tableName, java.lang.Object columnNameList, java.lang.Object properties)
          Initializer for a CreateIndexNode
 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()
           
 java.lang.String toString()
          Convert this object to a String.
private  void verifyAndGetUniqueNames()
          Check the uniqueness of the column names within the derived column list.
 
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, acceptChildren, 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, printSubNodes, 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

unique

boolean unique

dd

DataDictionary dd

properties

java.util.Properties properties

indexType

java.lang.String indexType

indexName

TableName indexName

tableName

TableName tableName

columnNameList

java.util.Vector columnNameList

columnNames

java.lang.String[] columnNames

isAscending

boolean[] isAscending

boundColumnIDs

int[] boundColumnIDs

td

TableDescriptor td
Constructor Detail

CreateIndexNode

public CreateIndexNode()
Method Detail

init

public void init(java.lang.Object unique,
                 java.lang.Object indexType,
                 java.lang.Object indexName,
                 java.lang.Object tableName,
                 java.lang.Object columnNameList,
                 java.lang.Object properties)
          throws StandardException
Initializer for a CreateIndexNode

Overrides:
init in class QueryTreeNode
Parameters:
unique - True means it's a unique index
indexType - The type of index
indexName - The name of the index
tableName - The name of the table the index will be on
columnNameList - A list of column names, in the order they appear in the index.
properties - The optional properties list associated with the index.
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

getUniqueness

public boolean getUniqueness()

getIndexType

public java.lang.String getIndexType()

getIndexName

public TableName getIndexName()

getBoundTableID

public UUID getBoundTableID()

getProperties

public java.util.Properties getProperties()

getIndexTableName

public TableName getIndexTableName()

getColumnNames

public java.lang.String[] getColumnNames()

getKeyColumnIDs

public int[] getKeyColumnIDs()

getIsAscending

public boolean[] getIsAscending()

bindStatement

public void bindStatement()
                   throws StandardException
Bind this CreateIndexNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the column name list does not contain any duplicate column names.

Overrides:
bindStatement in class StatementNode
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

verifyAndGetUniqueNames

private void verifyAndGetUniqueNames()
                              throws StandardException
Check the uniqueness of the column names within the derived column list.

Throws:
StandardException - Thrown if column list contains a duplicate name.

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

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