|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.TableElementList
A TableElementList represents the list of columns and other table elements such as constraints in a CREATE TABLE or ALTER TABLE statement.
Field Summary | |
private int |
numColumns
|
private TableDescriptor |
td
|
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
Constructor Summary | |
TableElementList()
|
Method Summary | |
Visitable |
accept(Visitor v)
Accept a visitor, and call v.visit() on child nodes as necessary. |
void |
addElement(QueryTreeNode qt)
|
void |
addTableElement(TableElementNode tableElement)
Add a TableElementNode to this TableElementList |
void |
appendNewColumnsToRCL(FromBaseTable table)
Append goobered up ResultColumns to the table's RCL. |
(package private) void |
bindAndValidateCheckConstraints(FromList fromList)
Bind and validate all of the check constraints in this list against the specified FromList. |
private void |
checkForDuplicateColumns(DDLStatementNode ddlStmt,
java.util.Hashtable ht,
java.lang.String colName)
Check to make sure that there are no duplicate column names in the list. |
private void |
checkForDuplicateConstraintNames(DDLStatementNode ddlStmt,
java.util.Hashtable ht,
java.lang.String constraintName)
Check to make sure that there are no duplicate constraint names in the list. |
private void |
checkForNullColumns(ConstraintDefinitionNode cdn,
TableDescriptor td)
|
private boolean |
columnsMatch(java.lang.String[] columnNames1,
java.lang.String[] columnNames2)
|
boolean |
containsColumnName(java.lang.String colName)
Determine whether or not the parameter matches a column name in this list. |
int |
countConstraints(int constraintType)
Count the number of constraints of the specified type. |
int |
countNumberOfColumns()
Count the number of columns. |
void |
destructiveAppend(QueryTreeNodeVector qtnv)
|
QueryTreeNode |
elementAt(int index)
|
int |
genColumnInfos(ColumnInfo[] colInfos)
Fill in the ColumnInfo[] for this table element list. |
(package private) void |
genConstraintActions(ConstraintConstantAction[] conActions,
java.lang.String tableName,
SchemaDescriptor tableSd,
DataDictionary dd)
Fill in the ConstraintConstantAction[] for this create/alter table. |
private IndexConstantAction |
genIndexAction(boolean isUnique,
java.lang.String indexName,
ConstraintDefinitionNode cdn,
java.lang.String[] columnNames,
boolean isConstraint,
SchemaDescriptor sd,
java.lang.String tableName,
int constraintType,
DataDictionary dd)
|
private DataTypeDescriptor |
getColumnDataTypeDescriptor(java.lang.String colName)
|
private DataTypeDescriptor |
getColumnDataTypeDescriptor(java.lang.String colName,
TableDescriptor td)
|
(package private) int |
indexOf(QueryTreeNode qt)
|
(package private) void |
insertElementAt(QueryTreeNode qt,
int index)
|
void |
nondestructiveAppend(QueryTreeNodeVector qtnv)
|
(package private) java.lang.Object |
remove(int index)
|
(package private) void |
removeAllElements()
|
(package private) void |
removeElement(QueryTreeNode qt)
|
(package private) void |
removeElementAt(int index)
|
private void |
setColumnListToNotNull(ConstraintDefinitionNode cdn)
Set all columns in that appear in a PRIMARY KEY constraint in a CREATE TABLE statement to NOT NULL. |
(package private) void |
setElementAt(QueryTreeNode qt,
int index)
|
int |
size()
|
java.lang.String |
toString()
Convert this object to a String. |
(package private) void |
validate(DDLStatementNode ddlStmt,
DataDictionary dd,
TableDescriptor td)
Validate this TableElementList. |
private void |
verifyUniqueColumnList(DDLStatementNode ddlStmt,
ConstraintDefinitionNode cdn)
Verify that a primary/unique table constraint has a valid column list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private int numColumns
private TableDescriptor td
Constructor Detail |
public TableElementList()
Method Detail |
public void addTableElement(TableElementNode tableElement)
tableElement
- The TableElementNode to add to this listpublic java.lang.String toString()
toString
in class QueryTreeNodeVector
void validate(DDLStatementNode ddlStmt, DataDictionary dd, TableDescriptor td) throws StandardException
ddlStmt
- DDLStatementNode which contains this listdd
- DataDictionary to usetd
- TableDescriptor for table, if existing table.
StandardException
- Thrown on errorpublic int countConstraints(int constraintType)
constraintType
- The constraint type to search for.
public int countNumberOfColumns()
public int genColumnInfos(ColumnInfo[] colInfos)
colInfos
- The ColumnInfo[] to be filled in.
public void appendNewColumnsToRCL(FromBaseTable table) throws StandardException
table
- The table in question.
StandardException
- Thrown on errorvoid bindAndValidateCheckConstraints(FromList fromList) throws StandardException
fromList
- The FromList in question.
StandardException
- Thrown on errorvoid genConstraintActions(ConstraintConstantAction[] conActions, java.lang.String tableName, SchemaDescriptor tableSd, DataDictionary dd) throws StandardException
conActions
- The ConstraintConstantAction[] to be filled in.tableName
- The name of the Table being created.tableSd
- The schema for that table.dd
- The DataDictionary
StandardException
- Thrown on failureprivate boolean columnsMatch(java.lang.String[] columnNames1, java.lang.String[] columnNames2)
private IndexConstantAction genIndexAction(boolean isUnique, java.lang.String indexName, ConstraintDefinitionNode cdn, java.lang.String[] columnNames, boolean isConstraint, SchemaDescriptor sd, java.lang.String tableName, int constraintType, DataDictionary dd) throws StandardException
StandardException
private void checkForDuplicateColumns(DDLStatementNode ddlStmt, java.util.Hashtable ht, java.lang.String colName) throws StandardException
ddlStmt
- DDLStatementNode which contains this listht
- Hashtable for enforcing uniqueness.colName
- Column name to check for.
StandardException
- Thrown on errorprivate void checkForDuplicateConstraintNames(DDLStatementNode ddlStmt, java.util.Hashtable ht, java.lang.String constraintName) throws StandardException
ddlStmt
- DDLStatementNode which contains this list
StandardException
- Thrown on errorprivate void verifyUniqueColumnList(DDLStatementNode ddlStmt, ConstraintDefinitionNode cdn) throws StandardException
ddlStmt
- The outer DDLStatementNodecdn
- The ConstraintDefinitionNode
StandardException
- Thrown if the column list is invalidprivate void setColumnListToNotNull(ConstraintDefinitionNode cdn)
cdn
- The ConstraintDefinitionNode for a PRIMARY KEY constraintprivate void checkForNullColumns(ConstraintDefinitionNode cdn, TableDescriptor td) throws StandardException
StandardException
private DataTypeDescriptor getColumnDataTypeDescriptor(java.lang.String colName)
private DataTypeDescriptor getColumnDataTypeDescriptor(java.lang.String colName, TableDescriptor td)
public boolean containsColumnName(java.lang.String colName)
colName
- The column name to search for.
public final int size()
public QueryTreeNode elementAt(int index)
public final void addElement(QueryTreeNode qt)
final void removeElementAt(int index)
final void removeElement(QueryTreeNode qt)
final java.lang.Object remove(int index)
final int indexOf(QueryTreeNode qt)
final void setElementAt(QueryTreeNode qt, int index)
public void destructiveAppend(QueryTreeNodeVector qtnv)
public void nondestructiveAppend(QueryTreeNodeVector qtnv)
final void removeAllElements()
final void insertElementAt(QueryTreeNode qt, int index)
public Visitable accept(Visitor v) throws StandardException
accept
in interface Visitable
accept
in class QueryTreeNode
v
- the visitor
StandardException
- on error
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |