SolarMetric Kodo JDO 3.2.4 generated on January 7 2005

kodo.jdbc.schema
Class Column

java.lang.Object
  |
  +--kodo.jdbc.schema.ReferenceCounter
        |
        +--kodo.jdbc.schema.Column
All Implemented Interfaces:
Comparable

public class Column
extends kodo.jdbc.schema.ReferenceCounter
implements Comparable

Represents a database column. Closely aligned with the column information available from DatabaseMetaData.


Field Summary
static int PRIORITY_DIRECT
           
static int PRIORITY_FK
           
static int PRIORITY_FK_CONST
           
static int PRIORITY_NONE
           
static int PRIORITY_PK
           
 
Constructor Summary
Column()
          Default constructor.
Column(String name, Table table)
          Constructor.
 
Method Summary
 int compareTo(Object other)
          Columns order on name.
 void deref()
           
 boolean equalsColumn(Column col)
          Tests compatibility.
 int getDecimalDigits()
          Return the number of decimal digits for the column, if applicable.
 String getDefault()
          Return the default value set for the column, if any.
 String getDescription()
          Useful for debugging.
 String getFullName()
          Return the column's full name, in the form <table>.<name>.
 int getIndex()
          Return the column's 0-based index in the owning table.
 String getName()
          Return the column's name.
 int getPriority()
           
 int getRefCount()
           
 String getSchemaName()
          The column's schema name.
 int getSize()
          Return the column's size.
 Table getTable()
          Return the table for the column.
 String getTableName()
          The column's table name.
 int getType()
          Return the column's SQL type.
 String getTypeName()
          If this column's type is not reflected in Types, set the type to Types.OTHER and set this string to the desired type name.
 boolean isAutoIncrement()
          Whether this column is auto-incrementing.
 boolean isCompatible(int type, int size)
          Return true if this column is compatible with the given JDBC type from Types and size.
 boolean isNotNull()
          Return true if this is a NOT NULL column.
 boolean isPrimaryKey()
          Return true if this column belongs to the table's primary key.
 void ref()
           
 void ref(int priority)
           
 void resetPriority()
           
 void setAutoIncrement(boolean autoInc)
          Whether this column is auto-incrementing.
 void setDecimalDigits(int digits)
          Set the number of decimal digits for the column.
 void setDefault(String def)
          Set the default value for the column.
 void setName(String name)
          Set the column's name.
 void setNotNull(boolean notNull)
          Set whether this is a NOT NULL column.
 void setSchemaName(String name)
          The column's schema name.
 void setSize(int size)
          Set the column's size.
 void setTableName(String name)
          The column's table name.
 void setType(int sqlType)
          Set the column's SQL type.
 void setTypeName(String typeName)
          If this column's type is not reflected in Types, set the type to Types.OTHER and set this string to the desired type name.
 String toString()
          Returns the column name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIORITY_PK

public static final int PRIORITY_PK

PRIORITY_DIRECT

public static final int PRIORITY_DIRECT

PRIORITY_FK

public static final int PRIORITY_FK

PRIORITY_FK_CONST

public static final int PRIORITY_FK_CONST

PRIORITY_NONE

public static final int PRIORITY_NONE
Constructor Detail

Column

public Column()
Default constructor.

Column

public Column(String name,
              Table table)
Constructor.
Parameters:
name - the name of the column
table - the column's table
Method Detail

ref

public void ref()
Overrides:
ref in class kodo.jdbc.schema.ReferenceCounter

ref

public void ref(int priority)

getPriority

public int getPriority()

resetPriority

public void resetPriority()

getTable

public Table getTable()
Return the table for the column.

getTableName

public String getTableName()
The column's table name.

setTableName

public void setTableName(String name)
The column's table name. You can only call this method on columns whose table object is not set.

getSchemaName

public String getSchemaName()
The column's schema name.

setSchemaName

public void setSchemaName(String name)
The column's schema name. You can only call this method on columns whose table object is not set.

getName

public String getName()
Return the column's name.

setName

public void setName(String name)
Set the column's name. You can only call this method on columns whose table object is not set.

getFullName

public String getFullName()
Return the column's full name, in the form <table>.<name>.

getType

public int getType()
Return the column's SQL type. This will be one of the type constants defined in Types.

setType

public void setType(int sqlType)
Set the column's SQL type. This should be one of the type constants defined in Types.

getTypeName

public String getTypeName()
If this column's type is not reflected in Types, set the type to Types.OTHER and set this string to the desired type name.

setTypeName

public void setTypeName(String typeName)
If this column's type is not reflected in Types, set the type to Types.OTHER and set this string to the desired type name.

getSize

public int getSize()
Return the column's size.

setSize

public void setSize(int size)
Set the column's size.

getDecimalDigits

public int getDecimalDigits()
Return the number of decimal digits for the column, if applicable.

setDecimalDigits

public void setDecimalDigits(int digits)
Set the number of decimal digits for the column.

getDefault

public String getDefault()
Return the default value set for the column, if any.

setDefault

public void setDefault(String def)
Set the default value for the column.

isNotNull

public boolean isNotNull()
Return true if this is a NOT NULL column.

setNotNull

public void setNotNull(boolean notNull)
Set whether this is a NOT NULL column.

isAutoIncrement

public boolean isAutoIncrement()
Whether this column is auto-incrementing.

setAutoIncrement

public void setAutoIncrement(boolean autoInc)
Whether this column is auto-incrementing.

isPrimaryKey

public boolean isPrimaryKey()
Return true if this column belongs to the table's primary key.

getIndex

public int getIndex()
Return the column's 0-based index in the owning table.

isCompatible

public boolean isCompatible(int type,
                            int size)
Return true if this column is compatible with the given JDBC type from Types and size.

compareTo

public int compareTo(Object other)
Columns order on name.
Specified by:
compareTo in interface Comparable

toString

public String toString()
Returns the column name.
Overrides:
toString in class Object

getDescription

public String getDescription()
Useful for debugging.

equalsColumn

public boolean equalsColumn(Column col)
Tests compatibility.

getRefCount

public int getRefCount()

deref

public void deref()

SolarMetric Kodo JDO 3.2.4 generated on January 7 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.