org.axiondb
Class Column

java.lang.Object
  extended by org.axiondb.Column
All Implemented Interfaces:
java.io.Serializable

public class Column
extends java.lang.Object
implements java.io.Serializable

Describes a column within a Table.

Version:
$Revision: 1.34 $ $Date: 2005/12/20 18:32:40 $
See Also:
Serialized Form

Field Summary
static java.lang.String COLUMN_SQL_TYPE_CONFIG_KEY
          Key for setting and retrieving the sqlType in this column's configuration
static java.lang.String DATA_TYPE_CONFIG_KEY
          Key for setting and retrieving the DataTypein this column's configuration
static java.lang.String DEFAULT_VALUE_CONFIG_KEY
          Key for setting and retrieving the default valuein this column's configuration
static java.lang.String GENERATED_ALWAYS
           
static java.lang.String GENERATED_BY_DEFAULT
           
static java.lang.String GENERATED_COLUMN_TYPE
          Key for setting and retrieving generated column expression
static java.lang.String IDENTITY_GENERATION_TYPE
          Key for setting and retrieving the Identity column generation type
static java.lang.String NAME_CONFIG_KEY
          Key for setting and retrieving the name in this column's configuration
 
Constructor Summary
Column(java.lang.String name, DataType type)
          Create column with the given name and type .
Column(java.lang.String name, DataType type, Selectable defaultValue)
          Create column with the given name and type .
 
Method Summary
 boolean equals(java.lang.Object that)
          Two Columns are equal if they have the same name.
 java.util.Map getConfiguration()
           
 DataType getDataType()
          Get the DataTypeof this column.
 Selectable getDefault()
           
 java.lang.String getGeneratedColType()
           
 java.lang.String getIdentityType()
           
 java.lang.String getName()
          Get the name of this column.
 int getScale()
           
 int getSize()
           
 java.lang.String getSqlType()
           
 boolean hasDefault()
           
 int hashCode()
           
 boolean isDerivedColumn()
           
 boolean isGeneratedAlways()
           
 boolean isGeneratedByDefault()
           
 boolean isIdentityColumn()
           
 void setGeneratedColType(java.lang.String type)
           
 void setIdentityType(java.lang.String type)
           
 void setSqlType(java.lang.String type)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_SQL_TYPE_CONFIG_KEY

public static final java.lang.String COLUMN_SQL_TYPE_CONFIG_KEY
Key for setting and retrieving the sqlType in this column's configuration

See Also:
Constant Field Values

DATA_TYPE_CONFIG_KEY

public static final java.lang.String DATA_TYPE_CONFIG_KEY
Key for setting and retrieving the DataTypein this column's configuration

See Also:
Constant Field Values

DEFAULT_VALUE_CONFIG_KEY

public static final java.lang.String DEFAULT_VALUE_CONFIG_KEY
Key for setting and retrieving the default valuein this column's configuration

See Also:
Constant Field Values

NAME_CONFIG_KEY

public static final java.lang.String NAME_CONFIG_KEY
Key for setting and retrieving the name in this column's configuration

See Also:
Constant Field Values

IDENTITY_GENERATION_TYPE

public static final java.lang.String IDENTITY_GENERATION_TYPE
Key for setting and retrieving the Identity column generation type

See Also:
Constant Field Values

GENERATED_ALWAYS

public static final java.lang.String GENERATED_ALWAYS
See Also:
Constant Field Values

GENERATED_BY_DEFAULT

public static final java.lang.String GENERATED_BY_DEFAULT
See Also:
Constant Field Values

GENERATED_COLUMN_TYPE

public static final java.lang.String GENERATED_COLUMN_TYPE
Key for setting and retrieving generated column expression

See Also:
Constant Field Values
Constructor Detail

Column

public Column(java.lang.String name,
              DataType type)
       throws java.lang.NullPointerException
Create column with the given name and type .

Parameters:
name - the name of this column, which MUST NOT be null
type - the DataTypeof this column, which MUST NOT be null
Throws:
java.lang.NullPointerException - if either parameter is null

Column

public Column(java.lang.String name,
              DataType type,
              Selectable defaultValue)
       throws java.lang.NullPointerException
Create column with the given name and type .

Parameters:
name - the name of this column, which MUST NOT be null
type - the DataTypeof this column, which MUST NOT be null
config - name-value pairs that configure this column
defaultValue - the default valuefor this column, which may be null
Throws:
java.lang.NullPointerException - if either name or type is null
Method Detail

equals

public boolean equals(java.lang.Object that)
Two Columns are equal if they have the same name.

Overrides:
equals in class java.lang.Object

getConfiguration

public final java.util.Map getConfiguration()

getDataType

public final DataType getDataType()
Get the DataTypeof this column.


getDefault

public final Selectable getDefault()

getName

public final java.lang.String getName()
Get the name of this column.


getScale

public int getScale()

getSize

public int getSize()

getSqlType

public java.lang.String getSqlType()

hasDefault

public boolean hasDefault()

isIdentityColumn

public boolean isIdentityColumn()

isGeneratedAlways

public boolean isGeneratedAlways()

isGeneratedByDefault

public boolean isGeneratedByDefault()

isDerivedColumn

public boolean isDerivedColumn()

setGeneratedColType

public void setGeneratedColType(java.lang.String type)

getGeneratedColType

public java.lang.String getGeneratedColType()

getIdentityType

public final java.lang.String getIdentityType()

setIdentityType

public void setIdentityType(java.lang.String type)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setSqlType

public void setSqlType(java.lang.String type)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object