com.akiban.sql.parser
Class RenameNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.StatementNode
          extended by com.akiban.sql.parser.DDLStatementNode
              extended by com.akiban.sql.parser.RenameNode
All Implemented Interfaces:
Visitable

public class RenameNode
extends DDLStatementNode

A RenameNode is the root of a QueryTree that represents a RENAME TABLE/COLUMN/INDEX statement.


Nested Class Summary
static class RenameNode.RenameType
           
 
Field Summary
protected  String newObjectName
           
protected  TableName newTableName
           
protected  String oldObjectName
           
protected  RenameNode.RenameType renamingWhat
           
protected  boolean usedAlterTable
           
 
Fields inherited from class com.akiban.sql.parser.DDLStatementNode
ADD_TYPE, DROP_TYPE, LOCKING_TYPE, MODIFY_TYPE, UNKNOWN_TYPE
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
RenameNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 String getNewObjectName()
           
 TableName getNewTableName()
           
 String getOldObjectName()
           
 RenameNode.RenameType getRenameType()
           
 void init(Object tableName, Object oldObjectName, Object newName, Object usedAlterTable, Object renamingWhat)
          Initializer for a RenameNode
 boolean isAlterTable()
           
 String statementToString()
           
 String toString()
          Convert this object to a String.
 
Methods inherited from class com.akiban.sql.parser.DDLStatementNode
getFullName, getObjectName, getRelativeName, init, initAndCheck, isAtomic
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, printSubNodes, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

newTableName

protected TableName newTableName

oldObjectName

protected String oldObjectName

newObjectName

protected String newObjectName

usedAlterTable

protected boolean usedAlterTable

renamingWhat

protected RenameNode.RenameType renamingWhat
Constructor Detail

RenameNode

public RenameNode()
Method Detail

init

public void init(Object tableName,
                 Object oldObjectName,
                 Object newName,
                 Object usedAlterTable,
                 Object renamingWhat)
          throws StandardException
Initializer for a RenameNode

Overrides:
init in class QueryTreeNode
Parameters:
tableName - The name of the table. This is the table which is being renamed in case of rename table. In case of rename column, the column being renamed belongs to this table. In case of rename index, this is null because index name is unique within a schema and doesn't have to be associated with a 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
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 table / column / index
Throws:
StandardException - Thrown on error

getRenameType

public RenameNode.RenameType getRenameType()

getNewTableName

public TableName getNewTableName()

isAlterTable

public boolean isAlterTable()

getOldObjectName

public String getOldObjectName()

getNewObjectName

public String getNewObjectName()

copyFrom

public void copyFrom(QueryTreeNode node)
              throws StandardException
Fill this node with a deep copy of the given node.

Overrides:
copyFrom in class DDLStatementNode
Throws:
StandardException

toString

public 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 String statementToString()
Specified by:
statementToString in class StatementNode


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.