Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public final Class ColumnDescriptor

extends TupleDescriptor
Class Inheritance
Imports
org.apache.derby.iapi.types.DataTypeDescriptor, .DataValueDescriptor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.catalog.DefaultInfo, .UUID

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

Field Summary

Modifier and TypeField and Description
pack-priv long
private boolean
private long
private long
private long
private DataValueDescriptor
private DefaultInfo
private String
private int
private DataTypeDescriptor
private UUID
private TableDescriptor
private UUID

Constructor Summary

AccessConstructor and Description
public
ColumnDescriptor(String
The name of the column
columnName
,
int
The ordinal position of the column
columnPosition
,
DataTypeDescriptor
A DataTypeDescriptor for the type of the column
columnType
,
DataValueDescriptor
A DataValueDescriptor representing the default value of the column, if any (null if no default)
columnDefault
,
DefaultInfo
The default info for the column.
columnDefaultInfo
,
TableDescriptor
A TableDescriptor for the table the column is in
table
,
UUID
The UUID for the default, if any.
defaultUUID
,
long
Start value for an autoincrement column.
autoincStart
,
long
Increment for autoincrement column
autoincInc
,
long
Adding an autoincrement column OR changing increment value or start value of the autoincrement column.
userChangedWhat
,
boolean autoincCycle)

Constructor for a ColumnDescriptor when the column involved is an autoincrement column.

public
ColumnDescriptor(String
The name of the column
columnName
,
int
The ordinal position of the column
columnPosition
,
DataTypeDescriptor
A DataTypeDescriptor for the type of the column
columnType
,
DataValueDescriptor
A DataValueDescriptor representing the default value of the column, if any (null if no default)
columnDefault
,
DefaultInfo
The default info for the column.
columnDefaultInfo
,
TableDescriptor
A TableDescriptor for the table the column is in
table
,
UUID
The UUID for the default, if any.
defaultUUID
,
long
Start value for an autoincrement column.
autoincStart
,
long
Increment for autoincrement column
autoincInc
,
boolean autoincCycle)

Constructor for a ColumnDescriptor

public
ColumnDescriptor(String
The name of the column
columnName
,
int
The ordinal position of the column
columnPosition
,
DataTypeDescriptor
A DataTypeDescriptor for the type of the column
columnType
,
DataValueDescriptor
A DataValueDescriptor representing the default value of the column, if any (null if no default)
columnDefault
,
DefaultInfo
The default info for the column.
columnDefaultInfo
,
UUID
A uuid for the object that this column is in.
uuid
,
UUID
The UUID for the default, if any.
defaultUUID
,
long
Start value for an autoincrement column.
autoincStart
,
long
Increment for autoincrement column
autoincInc
,
long
Current value of the autoincrement column
autoincValue
,
boolean autoincCycle)

Constructor for a ColumnDescriptor.

Method Summary

Modifier and TypeMethod and Description
private static void
assertAutoinc(boolean autoinc, long autoincInc, DefaultInfo defaultInfo)

public long
public boolean
public long

Returns:

the Increment value for an autoincrement column
getAutoincInc
()

Get the Increment value given by the user for an autoincrement column

public long

Returns:

Get the start value of an autoincrement column
getAutoincStart
()

Get the start value of an autoincrement column

public long

Returns:

the current value for an autoincrement column
getAutoincValue
()

Get the current value for an autoincrement column.

public String

Returns:

A String containing the name of the column.
getColumnName
()

Get the name of the column.

public DefaultDescriptor

Returns:

A DefaultDescriptor if this column has a column default.
getDefaultDescriptor
(DataDictionary
The DataDictionary.
dd
)

Get a DefaultDescriptor for the default, if any, associated with this column.

public DefaultInfo

Returns:

The DefaultInfo for this ColumnDescriptor.
getDefaultInfo
()

Get the DefaultInfo for this ColumnDescriptor.

public UUID

Returns:

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

Get the UUID for the column default, if any.

public DataValueDescriptor

Returns:

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

Get the default value for the column.

public String
public String
getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

public int

Returns:

The ordinal position of the column.
getPosition
()

Get the ordinal position of the column (1 based)

public UUID

Returns:

The UUID of the table the column is a part of.
getReferencingUUID
()

Get the UUID of the object the column is a part of.

public TableDescriptor

Returns:

The TableDescriptor of the column's table.
getTableDescriptor
()

Get the TableDescriptor of the column's table.

public DataTypeDescriptor

Returns:

The TypeDescriptor of the column's datatype.
getType
()

Get the TypeDescriptor of the column's datatype.

public boolean
hasGenerationClause()

Is this column a generated column

public boolean

Returns:

Whether or not there is a non-null default on this column.
hasNonNullDefault
()

Return whether or not there is a non-null default on this column.

public boolean
isAutoincAlways()

Is this column to have autoincremented value always ?

public boolean

Returns:

Whether or not this is an autoincrement column
isAutoincrement
()

Is this column an autoincrement column?

public void
public void
setColumnName(String
The new column name.
newColumnName
)

Sets the column name in case of rename column.

public void
setPosition(int columnPosition)

Set the ordinal position of the column.

public void
setTableDescriptor(TableDescriptor
The table descriptor for this column
tableDescriptor
)

Sets the table descriptor for the column.

public String

Returns:

A String representation of this ColumnDescriptor
toString
()

Overrides java.lang.Object.toString.

Convert the ColumnDescriptor to a String.

public boolean
Inherited from org.apache.derby.iapi.sql.dictionary.TupleDescriptor:
getColumnDependableFindergetDataDictionarygetDependableFinderisPersistentsetDataDictionary

Field Detail

autoinc_create_or_modify_Start_Incrementback to summary
pack-priv long autoinc_create_or_modify_Start_Increment
autoincCycleback to summary
private boolean autoincCycle
autoincIncback to summary
private long autoincInc
autoincStartback to summary
private long autoincStart
autoincValueback to summary
private long autoincValue
columnDefaultback to summary
private DataValueDescriptor columnDefault
columnDefaultInfoback to summary
private DefaultInfo columnDefaultInfo
columnNameback to summary
private String columnName
columnPositionback to summary
private int columnPosition
columnTypeback to summary
private DataTypeDescriptor columnType
defaultUUIDback to summary
private UUID defaultUUID
tableback to summary
private TableDescriptor table
uuidback to summary
private UUID uuid

Constructor Detail

ColumnDescriptorback to summary
public ColumnDescriptor(String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, TableDescriptor table, UUID defaultUUID, long autoincStart, long autoincInc, long userChangedWhat, boolean autoincCycle)

Constructor for a ColumnDescriptor when the column involved is an autoincrement column. The last parameter to this method indicates if an autoincrement column is getting added or if the autoincrement column is being modified to change the increment value or to change the start value

Parameters
columnName:String

The name of the column

columnPosition:int

The ordinal position of the column

columnType:DataTypeDescriptor

A DataTypeDescriptor for the type of the column

columnDefault:DataValueDescriptor

A DataValueDescriptor representing the default value of the column, if any (null if no default)

columnDefaultInfo:DefaultInfo

The default info for the column.

table:TableDescriptor

A TableDescriptor for the table the column is in

defaultUUID:UUID

The UUID for the default, if any.

autoincStart:long

Start value for an autoincrement column.

autoincInc:long

Increment for autoincrement column

userChangedWhat:long

Adding an autoincrement column OR changing increment value or start value of the autoincrement column.

ColumnDescriptorback to summary
public ColumnDescriptor(String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, TableDescriptor table, UUID defaultUUID, long autoincStart, long autoincInc, boolean autoincCycle)

Constructor for a ColumnDescriptor

Parameters
columnName:String

The name of the column

columnPosition:int

The ordinal position of the column

columnType:DataTypeDescriptor

A DataTypeDescriptor for the type of the column

columnDefault:DataValueDescriptor

A DataValueDescriptor representing the default value of the column, if any (null if no default)

columnDefaultInfo:DefaultInfo

The default info for the column.

table:TableDescriptor

A TableDescriptor for the table the column is in

defaultUUID:UUID

The UUID for the default, if any.

autoincStart:long

Start value for an autoincrement column.

autoincInc:long

Increment for autoincrement column

ColumnDescriptorback to summary
public ColumnDescriptor(String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, UUID uuid, UUID defaultUUID, long autoincStart, long autoincInc, long autoincValue, boolean autoincCycle)

Constructor for a ColumnDescriptor. Used when columnDescriptor doesn't know/care about a table descriptor.

Parameters
columnName:String

The name of the column

columnPosition:int

The ordinal position of the column

columnType:DataTypeDescriptor

A DataTypeDescriptor for the type of the column

columnDefault:DataValueDescriptor

A DataValueDescriptor representing the default value of the column, if any (null if no default)

columnDefaultInfo:DefaultInfo

The default info for the column.

uuid:UUID

A uuid for the object that this column is in.

defaultUUID:UUID

The UUID for the default, if any.

autoincStart:long

Start value for an autoincrement column.

autoincInc:long

Increment for autoincrement column

autoincValue:long

Current value of the autoincrement column

Method Detail

assertAutoincback to summary
private static void assertAutoinc(boolean autoinc, long autoincInc, DefaultInfo defaultInfo)
getAutoinc_create_or_modify_Start_Incrementback to summary
public long getAutoinc_create_or_modify_Start_Increment()
getAutoincCycleback to summary
public boolean getAutoincCycle()
getAutoincIncback to summary
public long getAutoincInc()

Get the Increment value given by the user for an autoincrement column

Returns:long

the Increment value for an autoincrement column

getAutoincStartback to summary
public long getAutoincStart()

Get the start value of an autoincrement column

Returns:long

Get the start value of an autoincrement column

getAutoincValueback to summary
public long getAutoincValue()

Get the current value for an autoincrement column. One case in which this is used involves dropping a column from a table. When ALTER TABLE DROP COLUMN runs, it drops the column from SYSCOLUMNS, and then must adjust the column positions of the other subsequent columns in the table to account for the removal of the dropped columns. This involves deleting and re-adding the column descriptors to SYSCOLUMNS, but during that process we must be careful to preserve the current value of any autoincrement column.

Returns:long

the current value for an autoincrement column

getColumnNameback to summary
public String getColumnName()

Get the name of the column.

Returns:String

A String containing the name of the column.

getDefaultDescriptorback to summary
public DefaultDescriptor getDefaultDescriptor(DataDictionary dd)

Get a DefaultDescriptor for the default, if any, associated with this column.

Parameters
dd:DataDictionary

The DataDictionary.

Returns:DefaultDescriptor

A DefaultDescriptor if this column has a column default.

getDefaultInfoback to summary
public DefaultInfo getDefaultInfo()

Get the DefaultInfo for this ColumnDescriptor.

Returns:DefaultInfo

The DefaultInfo for this ColumnDescriptor.

getDefaultUUIDback to summary
public UUID getDefaultUUID()

Get the UUID for the column default, if any.

Returns:UUID

The UUID for the column default, if any.

getDefaultValueback to summary
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:DataValueDescriptor

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

getDescriptorNameback to summary
public String getDescriptorName()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorName.

See Also
TupleDescriptor#getDescriptorName
getDescriptorTypeback to summary
public String getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Doc from org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

See Also
TupleDescriptor#getDescriptorType
getPositionback to summary
public int getPosition()

Get the ordinal position of the column (1 based)

Returns:int

The ordinal position of the column.

getReferencingUUIDback to summary
public UUID getReferencingUUID()

Get the UUID of the object the column is a part of.

Returns:UUID

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

getTableDescriptorback to summary
public TableDescriptor getTableDescriptor()

Get the TableDescriptor of the column's table.

Returns:TableDescriptor

The TableDescriptor of the column's table.

getTypeback to summary
public DataTypeDescriptor getType()

Get the TypeDescriptor of the column's datatype.

Returns:DataTypeDescriptor

The TypeDescriptor of the column's datatype.

hasGenerationClauseback to summary
public boolean hasGenerationClause()

Is this column a generated column

hasNonNullDefaultback to summary
public boolean hasNonNullDefault()

Return whether or not there is a non-null default on this column.

Returns:boolean

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

isAutoincAlwaysback to summary
public boolean isAutoincAlways()

Is this column to have autoincremented value always ?

isAutoincrementback to summary
public boolean isAutoincrement()

Is this column an autoincrement column?

Returns:boolean

Whether or not this is an autoincrement column

setAutoinc_create_or_modify_Start_Incrementback to summary
public void setAutoinc_create_or_modify_Start_Increment(int c_or_m)
setColumnNameback to summary
public void setColumnName(String newColumnName)

Sets the column name in case of rename column.

Parameters
newColumnName:String

The new column name.

setPositionback to summary
public void setPosition(int columnPosition)

Set the ordinal position of the column.

setTableDescriptorback to summary
public void setTableDescriptor(TableDescriptor tableDescriptor)

Sets the table descriptor for the column.

Parameters
tableDescriptor:TableDescriptor

The table descriptor for this column

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert the ColumnDescriptor to a String.

Returns:String

A String representation of this ColumnDescriptor

updatableByCursorback to summary
public boolean updatableByCursor()