Class CreateTableNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.StatementNode
org.apache.derby.impl.sql.compile.DDLStatementNode
org.apache.derby.impl.sql.compile.CreateTableNode
- All Implemented Interfaces:
Visitable
A CreateTableNode is the root of a QueryTree that represents a CREATE TABLE or DECLARE GLOBAL TEMPORARY TABLE
statement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate charprivate booleanprivate booleanprivate Propertiesprivate ResultSetNodeprivate ResultColumnListprivate TableElementListprotected intFields inherited from class DDLStatementNode
ADD_TYPE, DROP_STATISTICS, DROP_TYPE, implicitCreateSchema, LOCKING_TYPE, MODIFY_TYPE, UNKNOWN_TYPE, UPDATE_STATISTICSFields inherited from class StatementNode
EMPTY_TD_LIST, NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATIONFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionCreateTableNode(TableName tableName, ResultColumnList resultColumns, ResultSetNode queryExpression, ContextManager cm) Constructor for a CreateTableNode for a base table create from a queryCreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, boolean onCommitDeleteRows, boolean onRollbackDeleteRows, ContextManager cm) Constructor for a CreateTableNode for a global temporary tableCreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, char lockGranularity, ContextManager cm) Constructor for a CreateTableNode for a base table -
Method Summary
Modifier and TypeMethodDescription(package private) voidAccept the visitor for all visitable children of this node.voidBind this CreateTableNode.Create the Constant information that will drive the guts of Execution.(package private) voidprintSubNodes(int depth) Prints the sub-nodes of this object.booleanReturn true if the node references SESSION schema tables (temporary or permanent)(package private) Stringprivate static TableNametempTableSchemaNameCheck(TableName tableName) If no schema name specified for global temporary table, SESSION is the implicit schema.toString()Convert this object to a String.Methods inherited from class DDLStatementNode
activationKind, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, initAndCheck, isAtomic, makeFromListMethods inherited from class StatementNode
executeSchemaName, executeStatementName, generate, getCursorInfo, getSPSName, lockTableForCompilation, makeResultDescription, needsSavepoint, optimizeStatement, updateIndexStatisticsForMethods inherited from class QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
-
Field Details
-
lockGranularity
private char lockGranularity -
onCommitDeleteRows
private boolean onCommitDeleteRows -
onRollbackDeleteRows
private boolean onRollbackDeleteRows -
properties
-
tableElementList
-
tableType
protected int tableType -
resultColumns
-
queryExpression
-
-
Constructor Details
-
CreateTableNode
CreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, char lockGranularity, ContextManager cm) throws StandardException Constructor for a CreateTableNode for a base table- Parameters:
tableName- 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.cm- The context manager- Throws:
StandardException- Thrown on error
-
CreateTableNode
CreateTableNode(TableName tableName, TableElementList tableElementList, Properties properties, boolean onCommitDeleteRows, boolean onRollbackDeleteRows, ContextManager cm) throws StandardException Constructor for a CreateTableNode for a global temporary table- Parameters:
tableName- 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
-
CreateTableNode
CreateTableNode(TableName tableName, ResultColumnList resultColumns, ResultSetNode queryExpression, ContextManager cm) throws StandardException Constructor for a CreateTableNode for a base table create from a query- Parameters:
tableName- The name of the new object being created (ie base table).resultColumns- The optional column list.queryExpression- The query expression for the table.cm- The context manager- Throws:
StandardException
-
-
Method Details
-
tempTableSchemaNameCheck
If no schema name specified for global temporary table, SESSION is the implicit schema. Otherwise, make sure the specified schema name for global temporary table is SESSION.- Parameters:
tableName- The name of the new object being declared (ie temporary table)- Throws:
StandardException
-
toString
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.- Overrides:
toStringin classDDLStatementNode- Returns:
- This object as a String
-
printSubNodes
void printSubNodes(int depth) Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.- Overrides:
printSubNodesin classQueryTreeNode- Parameters:
depth- The depth to indent the sub-nodes
-
statementToString
String statementToString()- Specified by:
statementToStringin classStatementNode
-
bindStatement
Bind this CreateTableNode. This means doing any static error checking that can be done before actually creating the base table or declaring the global temporary table. For eg, verifying that the TableElementList does not contain any duplicate column names.- Overrides:
bindStatementin classStatementNode- Throws:
StandardException- Thrown on error
-
referencesSessionSchema
Return true if the node references SESSION schema tables (temporary or permanent)- Overrides:
referencesSessionSchemain classQueryTreeNode- Returns:
- true if references SESSION schema tables, else false
- Throws:
StandardException- Thrown on error
-
makeConstantAction
Create the Constant information that will drive the guts of Execution.- Overrides:
makeConstantActionin classQueryTreeNode- Throws:
StandardException- Thrown on failure
-
acceptChildren
Accept the visitor for all visitable children of this node.- Overrides:
acceptChildrenin classDDLStatementNode- Parameters:
v- the visitor- Throws:
StandardException- on error
-