com.akiban.sql.parser
Class CreateTableNode

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

public class CreateTableNode
extends DDLStatementNode

A CreateTableNode is the root of a QueryTree that represents a CREATE TABLE or DECLARE GLOBAL TEMPORARY TABLE statement.


Field Summary
static int BASE_TABLE_TYPE
           
static char DEFAULT_LOCK_GRANULARITY
           
static int GLOBAL_TEMPORARY_TABLE_TYPE
           
static char ROW_LOCK_GRANULARITY
           
static int SYNONYM_TYPE
           
static int SYSTEM_TABLE_TYPE
           
static char TABLE_LOCK_GRANULARITY
           
protected  int tableType
           
static int VIEW_TYPE
           
static int VTI_TYPE
           
 
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
CreateTableNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 ExistenceCheck getExistenceCheck()
           
 ResultSetNode getQueryExpression()
           
 TableElementList getTableElementList()
           
 void init(Object newObjectName, Object resultColumns, Object queryExpression, Object c)
          Initializer for a CreateTableNode for a base table create from a query
 void init(Object newObjectName, Object tableElementList, Object properties, Object lockGranularity, Object existenceCheck)
          Initializer for a CreateTableNode for a base table
 void init(Object newObjectName, Object tableElementList, Object properties, Object onCommitDeleteRows, Object onRollbackDeleteRows, Object existenceCheck)
          Initializer for a CreateTableNode for a global temporary table
 boolean isWithData()
           
 void markWithData()
           
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 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, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, 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

BASE_TABLE_TYPE

public static final int BASE_TABLE_TYPE
See Also:
Constant Field Values

SYSTEM_TABLE_TYPE

public static final int SYSTEM_TABLE_TYPE
See Also:
Constant Field Values

VIEW_TYPE

public static final int VIEW_TYPE
See Also:
Constant Field Values

GLOBAL_TEMPORARY_TABLE_TYPE

public static final int GLOBAL_TEMPORARY_TABLE_TYPE
See Also:
Constant Field Values

SYNONYM_TYPE

public static final int SYNONYM_TYPE
See Also:
Constant Field Values

VTI_TYPE

public static final int VTI_TYPE
See Also:
Constant Field Values

ROW_LOCK_GRANULARITY

public static final char ROW_LOCK_GRANULARITY
See Also:
Constant Field Values

TABLE_LOCK_GRANULARITY

public static final char TABLE_LOCK_GRANULARITY
See Also:
Constant Field Values

DEFAULT_LOCK_GRANULARITY

public static final char DEFAULT_LOCK_GRANULARITY
See Also:
Constant Field Values

tableType

protected int tableType
Constructor Detail

CreateTableNode

public CreateTableNode()
Method Detail

init

public void init(Object newObjectName,
                 Object tableElementList,
                 Object properties,
                 Object lockGranularity,
                 Object existenceCheck)
          throws StandardException
Initializer for a CreateTableNode for a base table

Overrides:
init in class QueryTreeNode
Parameters:
newObjectName - The name of the new object being created (ie base table)
tableElementList - The elements of the table: columns, constraints, etc.
properties - The optional list of properties associated with the table.
lockGranularity - The lock granularity.
Throws:
StandardException - Thrown on error

init

public void init(Object newObjectName,
                 Object tableElementList,
                 Object properties,
                 Object onCommitDeleteRows,
                 Object onRollbackDeleteRows,
                 Object existenceCheck)
          throws StandardException
Initializer for a CreateTableNode for a global temporary table

Overrides:
init in class QueryTreeNode
Parameters:
newObjectName - The name of the new object being declared (ie temporary table)
tableElementList - The elements of the table: columns, constraints, etc.
properties - The optional list of properties associated with the table.
onCommitDeleteRows - If true, on commit delete rows else on commit preserve rows of temporary table.
onRollbackDeleteRows - If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value
Throws:
StandardException - Thrown on error

init

public void init(Object newObjectName,
                 Object resultColumns,
                 Object queryExpression,
                 Object c)
          throws StandardException
Initializer for a CreateTableNode for a base table create from a query

Overrides:
init in class QueryTreeNode
Parameters:
newObjectName - The name of the new object being created (ie base table).
resultColumns - The optional column list.
queryExpression - The query expression for the table.
Throws:
StandardException - Thrown on error

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

getTableElementList

public TableElementList getTableElementList()

getQueryExpression

public ResultSetNode getQueryExpression()

isWithData

public boolean isWithData()

markWithData

public void markWithData()

getExistenceCheck

public ExistenceCheck getExistenceCheck()

printSubNodes

public void printSubNodes(int depth)
Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Overrides:
printSubNodes in class QueryTreeNode
Parameters:
depth - The depth to indent the sub-nodes

statementToString

public String statementToString()
Specified by:
statementToString in class StatementNode


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