org.apache.derby.iapi.sql.dictionary
Class ColumnDescriptor

java.lang.Object
  extended byorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
      extended byorg.apache.derby.iapi.sql.dictionary.ColumnDescriptor

public class ColumnDescriptor
extends TupleDescriptor

This class represents a column descriptor. public methods in this class are:

  1. long getAutoincStart()
  2. java.lang.String getColumnName()
  3. DefaultDescriptor getDefaultDescriptor(DataDictionary?dd)
  4. DefaultInfo getDefaultInfo
  5. UUID getDefaultUUID
  6. DataValueDescriptor getDefaultValue
  7. int getPosition()
  8. UUID getReferencingUUID()
  9. TableDescriptor getTableDescriptor
  10. DTD getType()
  11. hasNonNullDefault
  12. isAutoincrement
  13. setColumnName
  14. setPosition

Author:
Jeff Lichtman

Field Summary
(package private)  long autoincInc
           
(package private)  long autoincStart
           
(package private)  DataValueDescriptor columnDefault
           
(package private)  DefaultInfo columnDefaultInfo
           
(package private)  java.lang.String columnName
           
(package private)  int columnPosition
           
(package private)  DataTypeDescriptor columnType
           
(package private)  UUID defaultUUID
           
(package private)  TableDescriptor table
           
(package private)  UUID uuid
           
 
Fields inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
COLUMN_LIST, CONGLOMERATE_LIST, CONSTRAINT_LIST, TRIGGER_LIST
 
Constructor Summary
ColumnDescriptor(java.lang.String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, TableDescriptor table, UUID defaultUUID, long autoincStart, long autoincInc, boolean autoinc)
          Constructor for a ColumnDescriptor
ColumnDescriptor(java.lang.String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, UUID uuid, UUID defaultUUID, long autoincStart, long autoincInc, boolean autoinc)
          Constructor for a ColumnDescriptor.
 
Method Summary
private static void assertAutoinc(boolean autoinc, long autoincInc, DefaultInfo defaultInfo)
           
 long getAutoincInc()
          Get the Increment value given by the user for an autoincrement column
 long getAutoincStart()
          Get the start value of an autoincrement column
 java.lang.String getColumnName()
          Get the name of the column.
 DefaultDescriptor getDefaultDescriptor(DataDictionary dd)
          Get a DefaultDescriptor for the default, if any, associated with this column.
 DefaultInfo getDefaultInfo()
          Get the DefaultInfo for this ColumnDescriptor.
 UUID getDefaultUUID()
          Get the UUID for the column default, if any.
 DataValueDescriptor getDefaultValue()
          Get the default value for the column.
 java.lang.String getDescriptorName()
           
 java.lang.String getDescriptorType()
          Each descriptor must identify itself with its type; i.e index, check constraint whatever.
 int getPosition()
          Get the ordinal position of the column (1 based)
 UUID getReferencingUUID()
          Get the UUID of the object the column is a part of.
 TableDescriptor getTableDescriptor()
          Get the TableDescriptor of the column's table.
 DataTypeDescriptor getType()
          Get the TypeDescriptor of the column's datatype.
 boolean hasNonNullDefault()
          Return whether or not there is a non-null default on this column.
 boolean isAutoincAlways()
          Is this column to have autoincremented value always ?
 boolean isAutoincrement()
          Is this column an autoincrement column?
 void setColumnName(java.lang.String newColumnName)
          Sets the column name in case of rename column.
 void setPosition(int columnPosition)
          Set the ordinal position of the column.
 void setTableDescriptor(TableDescriptor tableDescriptor)
          Sets the table descriptor for the column.
 java.lang.String toString()
          Convert the ColumnDescriptor to a String.
 boolean updatableByCursor()
           
 
Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
getColumnDependableFinder, getDataDictionary, getDependableFinder, isPersistent, setDataDictionary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

columnDefaultInfo

DefaultInfo columnDefaultInfo

table

TableDescriptor table

columnName

java.lang.String columnName

columnPosition

int columnPosition

columnType

DataTypeDescriptor columnType

columnDefault

DataValueDescriptor columnDefault

uuid

UUID uuid

defaultUUID

UUID defaultUUID

autoincStart

long autoincStart

autoincInc

long autoincInc
Constructor Detail

ColumnDescriptor

public ColumnDescriptor(java.lang.String columnName,
                        int columnPosition,
                        DataTypeDescriptor columnType,
                        DataValueDescriptor columnDefault,
                        DefaultInfo columnDefaultInfo,
                        TableDescriptor table,
                        UUID defaultUUID,
                        long autoincStart,
                        long autoincInc,
                        boolean autoinc)
Constructor for a ColumnDescriptor

Parameters:
columnName - The name of the column
columnPosition - The ordinal position of the column
columnType - A DataTypeDescriptor for the type of the column
columnDefault - A DataValueDescriptor representing the default value of the column, if any (null if no default)
columnDefaultInfo - The default info for the column.
table - A TableDescriptor for the table the column is in
defaultUUID - The UUID for the default, if any.
autoincStart - Start value for an autoincrement column.
autoincInc - Increment for autoincrement column
autoinc - boolean value for sanity checking.

ColumnDescriptor

public ColumnDescriptor(java.lang.String columnName,
                        int columnPosition,
                        DataTypeDescriptor columnType,
                        DataValueDescriptor columnDefault,
                        DefaultInfo columnDefaultInfo,
                        UUID uuid,
                        UUID defaultUUID,
                        long autoincStart,
                        long autoincInc,
                        boolean autoinc)
Constructor for a ColumnDescriptor. Used when columnDescriptor doesn't know/care about a table descriptor.

Parameters:
columnName - The name of the column
columnPosition - The ordinal position of the column
columnType - A DataTypeDescriptor for the type of the column
columnDefault - A DataValueDescriptor representing the default value of the column, if any (null if no default)
columnDefaultInfo - The default info for the column.
uuid - A uuid for the object that this column is in.
defaultUUID - The UUID for the default, if any.
autoincStart - Start value for an autoincrement column.
autoincInc - Increment for autoincrement column
autoinc - Boolean value, for sanity checking.
Method Detail

getReferencingUUID

public UUID getReferencingUUID()
Get the UUID of the object the column is a part of.

Returns:
The UUID of the table the column is a part of.

getTableDescriptor

public TableDescriptor getTableDescriptor()
Get the TableDescriptor of the column's table.

Returns:
The TableDescriptor of the column's table.

getColumnName

public java.lang.String getColumnName()
Get the name of the column.

Returns:
A String containing the name of the column.

setColumnName

public void setColumnName(java.lang.String newColumnName)
Sets the column name in case of rename column.

Parameters:
newColumnName - The new column name.

setTableDescriptor

public void setTableDescriptor(TableDescriptor tableDescriptor)
Sets the table descriptor for the column.

Parameters:
tableDescriptor - The table descriptor for this column

getPosition

public int getPosition()
Get the ordinal position of the column (1 based)

Returns:
The ordinal position of the column.

getType

public DataTypeDescriptor getType()
Get the TypeDescriptor of the column's datatype.

Returns:
The TypeDescriptor of the column's datatype.

hasNonNullDefault

public boolean hasNonNullDefault()
Return whether or not there is a non-null default on this column.

Returns:
Whether or not there is a non-null default on this column.

getDefaultValue

public DataValueDescriptor getDefaultValue()
Get the default value for the column. For columns with primitive types, the object returned will be of the corresponding object type. For example, for a float column, getDefaultValue() will return a Float.

Returns:
An object with the value and type of the default value for the column. Returns NULL if there is no default.

getDefaultInfo

public DefaultInfo getDefaultInfo()
Get the DefaultInfo for this ColumnDescriptor.

Returns:
The DefaultInfo for this ColumnDescriptor.

getDefaultUUID

public UUID getDefaultUUID()
Get the UUID for the column default, if any.

Returns:
The UUID for the column default, if any.

getDefaultDescriptor

public DefaultDescriptor getDefaultDescriptor(DataDictionary dd)
Get a DefaultDescriptor for the default, if any, associated with this column.

Parameters:
dd - The DataDictionary.
Returns:
A DefaultDescriptor if this column has a column default.

isAutoincrement

public boolean isAutoincrement()
Is this column an autoincrement column?

Returns:
Whether or not this is an autoincrement column

updatableByCursor

public boolean updatableByCursor()

isAutoincAlways

public boolean isAutoincAlways()
Is this column to have autoincremented value always ?


getAutoincStart

public long getAutoincStart()
Get the start value of an autoincrement column

Returns:
Get the start value of an autoincrement column

getAutoincInc

public long getAutoincInc()
Get the Increment value given by the user for an autoincrement column

Returns:
the Increment value for an autoincrement column

setPosition

public void setPosition(int columnPosition)
Set the ordinal position of the column.

Returns:
void.

toString

public java.lang.String toString()
Convert the ColumnDescriptor to a String.

Returns:
A String representation of this ColumnDescriptor

getDescriptorName

public java.lang.String getDescriptorName()
Overrides:
getDescriptorName in class TupleDescriptor
See Also:
TupleDescriptor.getDescriptorName()

getDescriptorType

public java.lang.String getDescriptorType()
Description copied from class: TupleDescriptor
Each descriptor must identify itself with its type; i.e index, check constraint whatever.

Overrides:
getDescriptorType in class TupleDescriptor
See Also:
TupleDescriptor.getDescriptorType()

assertAutoinc

private static void assertAutoinc(boolean autoinc,
                                  long autoincInc,
                                  DefaultInfo defaultInfo)

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.