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

pack-priv Class CreateIndexNode

extends DDLStatementNode
Class Inheritance
Imports
java.util.HashSet, .List, .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.property.PropertyUtil, org.apache.derby.iapi.sql.compile.Visitor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.dictionary.ColumnDescriptor, .SchemaDescriptor, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.types.DataTypeDescriptor

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

Field Summary

Modifier and TypeField and Description
private int[]
private List<String>
private String[]
private TableName
private String
private boolean[]
private Properties
private TableName
private TableDescriptor
private boolean
Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
ADD_TYPEDROP_STATISTICSDROP_TYPEimplicitCreateSchemaLOCKING_TYPEMODIFY_TYPEUNKNOWN_TYPEUPDATE_STATISTICS

Constructor Summary

AccessConstructor and Description
pack-priv
CreateIndexNode(boolean
True means it's a unique index
unique
,
String
The type of index
indexType
,
TableName
The name of the index
indexName
,
TableName
The name of the table the index will be on
tableName
,
List<String>
A list of column names, in the order they appear in the index.
columnNameList
,
Properties
The optional properties list associated with the index.
properties
,
ContextManager
Context manager
cm
)

Constructor for a CreateIndexNode

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 a visitor on all child nodes.

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.

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.

private void
verifyAndGetUniqueNames()

Check the uniqueness of the column names within the derived column list.

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

Field Detail

boundColumnIDsback to summary
private int[] boundColumnIDs
columnNameListback to summary
private List<String> columnNameList
columnNamesback to summary
private String[] columnNames
indexNameback to summary
private TableName indexName
indexTypeback to summary
private String indexType
isAscendingback to summary
private boolean[] isAscending
propertiesback to summary
private Properties properties
tableNameback to summary
private TableName tableName

Hides org.apache.derby.impl.sql.compile.DDLStatementNode.tableName.

tdback to summary
private TableDescriptor td
uniqueback to summary
private boolean unique

Constructor Detail

CreateIndexNodeback to summary
pack-priv CreateIndexNode(boolean unique, String indexType, TableName indexName, TableName tableName, List<String> columnNameList, Properties properties, ContextManager cm) throws StandardException

Constructor for a CreateIndexNode

Parameters
unique:boolean

True means it's a unique index

indexType:String

The type of index

indexName:TableName

The name of the index

tableName:TableName

The name of the table the index will be on

columnNameList:List<String>

A list of column names, in the order they appear in the index.

properties:Properties

The optional properties list associated with the index.

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.

Doc from org.apache.derby.impl.sql.compile.QueryTreeNode.acceptChildren.

Accept a visitor on all child nodes. All sub-classes that add fields that should be visited, should override this method and call accept(v) on all visitable fields, as well as super.acceptChildren(v) to make sure all visitable fields defined by the super-class are accepted too.

Parameters
v:Visitor

the visitor

Annotations
@Override
Exceptions
StandardException:
on errors raised by the visitor
bindStatementback to summary
public void bindStatement() throws StandardException

Overrides org.apache.derby.impl.sql.compile.StatementNode.bindStatement.

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.

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
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
verifyAndGetUniqueNamesback to summary
private void verifyAndGetUniqueNames() throws StandardException

Check the uniqueness of the column names within the derived column list.

Exceptions
StandardException:
Thrown if column list contains a duplicate name.