|
||||||||||
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.TableElementNode
org.apache.derby.impl.sql.compile.ColumnDefinitionNode
A ColumnDefinitionNode represents a column definition in a DDL statement. There will be a ColumnDefinitionNode for each column in a CREATE TABLE statement, and for the column in an ALTER TABLE ADD COLUMN statement.
Field Summary | |
(package private) long |
autoincrementIncrement
|
(package private) long |
autoincrementStart
|
(package private) boolean |
autoincrementVerify
|
(package private) DataTypeDescriptor |
dataTypeServices
|
(package private) DefaultInfoImpl |
defaultInfo
|
(package private) DefaultNode |
defaultNode
|
(package private) DataValueDescriptor |
defaultValue
|
(package private) boolean |
isAutoincrement
|
Fields inherited from class org.apache.derby.impl.sql.compile.TableElementNode |
AT_ADD_CHECK_CONSTRAINT, AT_ADD_FOREIGN_KEY_CONSTRAINT, AT_ADD_PRIMARY_KEY_CONSTRAINT, AT_ADD_UNIQUE_CONSTRAINT, AT_DROP_COLUMN, AT_DROP_CONSTRAINT, AT_MODIFY_COLUMN, AT_UNKNOWN, elementType, name |
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 | |
ColumnDefinitionNode()
|
Method Summary | |
private void |
autoincrementCheckRange(long minValue,
long maxValue,
java.lang.String typeName)
checks to see if autoincrementIncrement and autoincrementInitial are within the bounds of the type whose min and max values are passed into this routine. |
(package private) void |
bindAndValidateDefault(DataDictionary dd,
TableDescriptor td)
Check the validity of the default, if any, for this node. |
void |
checkUserType(TableDescriptor td)
Check the validity of a user type. |
boolean |
defaultTypeIsValid(TypeId columnType,
DataTypeDescriptor columnDesc,
TypeId defaultType,
ValueNode defaultNode,
java.lang.String defaultText)
Check the validity of the default for this node |
(package private) int |
getAction()
Get the action associated with this node. |
(package private) long |
getAutoincrementIncrement()
Get the autoincrement increment value |
(package private) long |
getAutoincrementStart()
Get the autoincrement start value |
java.lang.String |
getColumnName()
Returns the unqualified name of the column being defined. |
DataTypeDescriptor |
getDataTypeServices()
Returns the data type services of the column being defined. |
DefaultInfo |
getDefaultInfo()
Return the DefaultInfo containing the default information for this column |
DefaultNode |
getDefaultNode()
Return the DefaultNode, if any, associated with this node. |
DataValueDescriptor |
getDefaultValue()
Return the DataValueDescriptor containing the default value for this column |
(package private) UUID |
getOldDefaultUUID()
Get the UUID of the old column default. |
void |
init(java.lang.Object name,
java.lang.Object defaultNode,
java.lang.Object dataTypeServices,
java.lang.Object autoIncrementInfo)
Initializer for a ColumnDefinitionNode |
boolean |
isAutoincrementColumn()
Is this an autoincrement column? |
java.lang.String |
toString()
Convert this object to a String. |
void |
validateAutoincrement(DataDictionary dd,
TableDescriptor td,
int tableType)
Check the validity of the autoincrement values for this node. |
(package private) void |
validateDefault(DataDictionary dd,
TableDescriptor td)
Check the validity of the default for this node. |
Methods inherited from class org.apache.derby.impl.sql.compile.TableElementNode |
getElementType, getName, hasCheckConstraint, hasConstraint, hasForeignKeyConstraint, hasPrimaryKeyConstraint, hasUniqueKeyConstraint, init, init |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
boolean isAutoincrement
DataTypeDescriptor dataTypeServices
DataValueDescriptor defaultValue
DefaultInfoImpl defaultInfo
DefaultNode defaultNode
long autoincrementIncrement
long autoincrementStart
boolean autoincrementVerify
Constructor Detail |
public ColumnDefinitionNode()
Method Detail |
public void init(java.lang.Object name, java.lang.Object defaultNode, java.lang.Object dataTypeServices, java.lang.Object autoIncrementInfo) throws StandardException
init
in class QueryTreeNode
name
- The name of the columndefaultNode
- The default value of the columndataTypeServices
- A DataTypeServices telling the type
of the columnautoIncrementInfo
- Info for autoincrement columns
StandardException
- Thrown on errorpublic java.lang.String toString()
toString
in class TableElementNode
public java.lang.String getColumnName()
public DataTypeDescriptor getDataTypeServices()
public DataValueDescriptor getDefaultValue()
public DefaultInfo getDefaultInfo()
public DefaultNode getDefaultNode()
public boolean isAutoincrementColumn()
long getAutoincrementStart()
long getAutoincrementIncrement()
public void checkUserType(TableDescriptor td) throws StandardException
StandardException
- Thrown on errorUUID getOldDefaultUUID()
int getAction()
void bindAndValidateDefault(DataDictionary dd, TableDescriptor td) throws StandardException
dd
- The DataDictionary.td
- The TableDescriptor.
StandardException
- Thrown on errorpublic void validateAutoincrement(DataDictionary dd, TableDescriptor td, int tableType) throws StandardException
dd
- DataDictionary.td
- table descriptor.tableType
- base table or declared global temporary table.
StandardException
- if autoincrement default is incorrect; i.e
if increment is 0 or if initial or increment values are out
of range for the datatype.private void autoincrementCheckRange(long minValue, long maxValue, java.lang.String typeName) throws StandardException
StandardException
void validateDefault(DataDictionary dd, TableDescriptor td) throws StandardException
td
- The TableDescriptor.
StandardException
- Thrown on errorpublic boolean defaultTypeIsValid(TypeId columnType, DataTypeDescriptor columnDesc, TypeId defaultType, ValueNode defaultNode, java.lang.String defaultText)
columnType
- TypeId of the target column.columnDesc
- Description of the type of the
target column.defaultType
- TypeId of the default node.defaultNode
- Parsed ValueNode for the default value.defaultText
- Unparsed default value (as entered
by user).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |