org.apache.derby.impl.sql.execute
Class RenameConstantAction

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericConstantAction
      extended byorg.apache.derby.impl.sql.execute.DDLConstantAction
          extended byorg.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
              extended byorg.apache.derby.impl.sql.execute.RenameConstantAction
All Implemented Interfaces:
ConstantAction

class RenameConstantAction
extends DDLSingleTableConstantAction

This class describes actions that are ALWAYS performed for a RENAME TABLE/COLUMN/INDEX Statement at Execution time.

Author:
Mamta Satoor.

Field Summary
private  java.lang.String fullTableName
           
private  java.lang.String newObjectName
           
private  java.lang.String newTableName
           
private  java.lang.String oldObjectName
           
private  int renamingWhat
           
private  UUID schemaId
           
private  SchemaDescriptor sd
           
protected  UUID tableId
           
private  java.lang.String tableName
           
private  boolean usedAlterTable
           
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
RUNTIMESTATISTICS, STATISTICSTIMING
 
Constructor Summary
RenameConstantAction(java.lang.String fullTableName, java.lang.String tableName, java.lang.String oldObjectName, java.lang.String newObjectName, SchemaDescriptor sd, UUID tableId, boolean usedAlterTable, int renamingWhat)
          Make the ConstantAction for a RENAME TABLE/COLUMN/INDEX statement.
 
Method Summary
private  void execGutsRenameColumn(TableDescriptor td, Activation activation)
           
private  void execGutsRenameIndex(TableDescriptor td, Activation activation)
           
private  void execGutsRenameTable(TableDescriptor td, Activation activation)
           
 void executeConstantAction(Activation activation)
          The guts of the Execution-time logic for RENAME TABLE/COLUMN/INDEX.
 java.lang.String getTableName()
           
 boolean modifiesTableId(UUID tableId)
          Does this constant action modify the passed in table uuid?
 java.lang.String toString()
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, readExternal, upToDate, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fullTableName

private java.lang.String fullTableName

tableName

private java.lang.String tableName

newTableName

private java.lang.String newTableName

oldObjectName

private java.lang.String oldObjectName

newObjectName

private java.lang.String newObjectName

schemaId

private UUID schemaId

sd

private SchemaDescriptor sd

usedAlterTable

private boolean usedAlterTable

renamingWhat

private int renamingWhat

tableId

protected UUID tableId
Constructor Detail

RenameConstantAction

public RenameConstantAction(java.lang.String fullTableName,
                            java.lang.String tableName,
                            java.lang.String oldObjectName,
                            java.lang.String newObjectName,
                            SchemaDescriptor sd,
                            UUID tableId,
                            boolean usedAlterTable,
                            int renamingWhat)
Make the ConstantAction for a RENAME TABLE/COLUMN/INDEX statement.

Parameters:
fullTableName - Fully qualified table name
tableName - Table name.
oldObjectName - This is either the name of column/index in case of rename column/index. For rename table, this is null.
newObjectName - This is new name for table/column/index
sd - Schema that table lives in.
tableId - UUID for table
usedAlterTable - True-Used Alter Table, False-Used Rename. For rename index, this will always be false because there is no alter table command to rename index
renamingWhat - Rename a 1 - table, 2 - column, 3 - index
Method Detail

toString

public java.lang.String toString()

executeConstantAction

public void executeConstantAction(Activation activation)
                           throws StandardException
The guts of the Execution-time logic for RENAME TABLE/COLUMN/INDEX.

Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

execGutsRenameTable

private void execGutsRenameTable(TableDescriptor td,
                                 Activation activation)
                          throws StandardException
Throws:
StandardException

execGutsRenameColumn

private void execGutsRenameColumn(TableDescriptor td,
                                  Activation activation)
                           throws StandardException
Throws:
StandardException

execGutsRenameIndex

private void execGutsRenameIndex(TableDescriptor td,
                                 Activation activation)
                          throws StandardException
Throws:
StandardException

getTableName

public java.lang.String getTableName()

modifiesTableId

public boolean modifiesTableId(UUID tableId)
Does this constant action modify the passed in table uuid? By modify we mean add or drop things tied to this table (e.g. index, trigger, constraint). Things like views or spses that reference this table don't count.

Specified by:
modifiesTableId in interface ConstantAction
Overrides:
modifiesTableId in class DDLConstantAction
Parameters:
tableId - the table id


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