|
||||||||||
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 | |
(package private) int |
numColumns
|
(package 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 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)
|
(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,
TableDescriptor td)
Set all columns in that appear in a primary/unique key constraint in a create table statement to NOT NULL in Cloudscape mode and raises an error in DB2 mode. |
private void |
setColumnToNotNull(java.lang.String colName)
Set a column that appears in a primary/unique key constraint in a create table statement to NOT NULL (but only in Cloudscape mode). |
(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 |
int numColumns
TableDescriptor td
Constructor Detail |
public TableElementList()
Method Detail |
public void addTableElement(TableElementNode tableElement)
tableElement
- The TableElementNode to add to this list
public 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
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.dd
- The DataDictionary
StandardException
- Thrown on failureprivate boolean columnsMatch(java.lang.String[] columnNames1, java.lang.String[] columnNames2) throws StandardException
StandardException
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, TableDescriptor td) throws StandardException
cdn
- The ConstraintDefinitionNodetd
- TableDescriptor for the table
StandardException
private void setColumnToNotNull(java.lang.String colName) throws StandardException
colName
- The column name
StandardException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |