net.sf.jaxme.sqls.impl
Class ColumnImpl

java.lang.Object
  extended bynet.sf.jaxme.sqls.impl.ColumnImpl
All Implemented Interfaces:
BinaryColumn, Column, StringColumn
Direct Known Subclasses:
DB2ColumnImpl, HsqlDbColumnImpl

public class ColumnImpl
extends java.lang.Object
implements Column, StringColumn, BinaryColumn

Implementation of a column.

Author:
Jochen Wiedmann

Nested Class Summary
static class ColumnImpl.NameImpl
           
static class ColumnImpl.TypeImpl
           
 
Nested classes inherited from class net.sf.jaxme.sqls.Column
Column.Name, Column.Type
 
Constructor Summary
protected ColumnImpl(Table pTable, Column.Name pName, Column.Type pType)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Long getLength()
          If the column has fixed length: Returns the columns length.
 Column.Name getName()
          Returns the columns name.
 java.lang.String getQName()
          Returns the columns fully qualified name, which is getTable().getQName() + "." + getName().
 Table getTable()
          Returns the columns table.
 Column.Type getType()
          Returns the columns type.
 boolean hasFixedLength()
          Returns whether the column has fixed or variable length.
 int hashCode()
           
 boolean isBinaryColumn()
          Returns whether this Column may be casted to a BinaryColumn.
 boolean isNullable()
          Returns whether the column is nullable.
 boolean isPrimaryKeyPart()
          Returns whether this column is part of the primary key.
 boolean isStringColumn()
          Returns whether this Column may be casted to a StringColumn.
 void setLength(long pLength)
          Shortcut for setLength(new Integer(pLength)).
 void setLength(java.lang.Long pLength)
          If the column has fixed length: Sets the columns length.
 void setNullable(boolean pNullable)
          Sets whether the column is nullable.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnImpl

protected ColumnImpl(Table pTable,
                     Column.Name pName,
                     Column.Type pType)
Method Detail

getTable

public Table getTable()
Description copied from interface: Column

Returns the columns table.

Specified by:
getTable in interface Column

getName

public Column.Name getName()
Description copied from interface: Column

Returns the columns name.

Specified by:
getName in interface Column

getQName

public java.lang.String getQName()
Description copied from interface: Column

Returns the columns fully qualified name, which is getTable().getQName() + "." + getName().

Specified by:
getQName in interface Column

getType

public Column.Type getType()
Description copied from interface: Column

Returns the columns type.

Specified by:
getType in interface Column

isNullable

public boolean isNullable()
Description copied from interface: Column

Returns whether the column is nullable. By default columns are not nullable.

Specified by:
isNullable in interface Column

setNullable

public void setNullable(boolean pNullable)
Description copied from interface: Column

Sets whether the column is nullable. By default columns are not nullable.

Specified by:
setNullable in interface Column

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

isPrimaryKeyPart

public boolean isPrimaryKeyPart()
Description copied from interface: Column

Returns whether this column is part of the primary key.

Specified by:
isPrimaryKeyPart in interface Column

hasFixedLength

public boolean hasFixedLength()
Description copied from interface: StringColumn

Returns whether the column has fixed or variable length.

Specified by:
hasFixedLength in interface StringColumn

isStringColumn

public boolean isStringColumn()
Description copied from interface: Column

Returns whether this Column may be casted to a StringColumn.

Specified by:
isStringColumn in interface Column

isBinaryColumn

public boolean isBinaryColumn()
Description copied from interface: Column

Returns whether this Column may be casted to a BinaryColumn.

Specified by:
isBinaryColumn in interface Column

setLength

public void setLength(java.lang.Long pLength)
Description copied from interface: StringColumn

If the column has fixed length: Sets the columns length. Otherwise sets the columns maximum length.

Specified by:
setLength in interface StringColumn

setLength

public void setLength(long pLength)
Description copied from interface: StringColumn

Shortcut for setLength(new Integer(pLength)).

Specified by:
setLength in interface StringColumn

getLength

public java.lang.Long getLength()
Description copied from interface: StringColumn

If the column has fixed length: Returns the columns length. Otherwise returns the columns maximum length.

Specified by:
getLength in interface StringColumn