uk.org.ogsadai.converters.databaseschema
Class ColumnMetaDataImpl

java.lang.Object
  |
  +--uk.org.ogsadai.converters.databaseschema.ColumnMetaDataImpl
All Implemented Interfaces:
ColumnMetaData

public class ColumnMetaDataImpl
extends java.lang.Object
implements ColumnMetaData

An simple implementation of ColumnMetaData which stores column metadata.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  int mColumnSize
           
private  int mDataType
           
private  int mDecimalDigits
           
private  java.lang.String mFullName
           
private  boolean mIsNullable
           
private  boolean mIsPrimaryKey
           
private  java.lang.String mName
           
private  int mPosition
           
private  TableMetaData mTable
           
private  java.lang.String mTypeName
           
 
Constructor Summary
ColumnMetaDataImpl(java.lang.String name, int position, TableMetaData table)
          Constructs a new column metadata object with the given name, column number and table.
 
Method Summary
 int getColumnSize()
          Returns the column size.
 int getDataType()
          Returns the java type of the column.
 int getDecimalDigits()
          Returns the number of decimal digits in this column if the column type is a numerical type.
 java.lang.String getFullName()
          Returns the full name of the column.
 java.lang.String getName()
          Returns the name of the column.
 int getPosition()
          Returns the ordinal position (column number) of this column in the table.
 java.lang.String getSQLType()
          Returns the SQL type of this column.
 TableMetaData getTable()
          Returns the table that this column belongs to.
 boolean isNullable()
          Indicates whether this column can contain NULL values.
 boolean isPrimaryKey()
          Returns the primary key property of this column
 void setColumnSize(int colSize)
          Set the column size.
 void setDataType(int type)
          Set the data type of this column.
 void setDecimalDigits(int digits)
          Set the number of decimal digits.
 void setFullName(java.lang.String fullName)
          Set the full name of this column.
 void setNullable(boolean isNullable)
          Specify whether the column can contain the value NULL.
 void setPrimaryKey(boolean isPrimaryKey)
          Sets the primary key property of this column.
 void setTypeName(java.lang.String name)
          Set the SQL type name of this column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mName

private java.lang.String mName

mFullName

private java.lang.String mFullName

mPosition

private int mPosition

mTable

private TableMetaData mTable

mDataType

private int mDataType

mTypeName

private java.lang.String mTypeName

mColumnSize

private int mColumnSize

mDecimalDigits

private int mDecimalDigits

mIsNullable

private boolean mIsNullable

mIsPrimaryKey

private boolean mIsPrimaryKey
Constructor Detail

ColumnMetaDataImpl

public ColumnMetaDataImpl(java.lang.String name,
                          int position,
                          TableMetaData table)
Constructs a new column metadata object with the given name, column number and table.

Parameters:
name - Column name.
position - Column number.
table - Table where this column is stored.
Method Detail

setFullName

public void setFullName(java.lang.String fullName)
Set the full name of this column.

Parameters:
fullName - Full name.

setDataType

public void setDataType(int type)
Set the data type of this column.

Parameters:
type - Data type.

setTypeName

public void setTypeName(java.lang.String name)
Set the SQL type name of this column.

Parameters:
name - SQL type name.

setColumnSize

public void setColumnSize(int colSize)
Set the column size. For character type columns this is the number of characters; for number types this is the precision.

Parameters:
colSize - Column size.

setDecimalDigits

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

Parameters:
digits - Decimal digits.

setNullable

public void setNullable(boolean isNullable)
Specify whether the column can contain the value NULL.

Parameters:
isNullable - true if the column is nullable, false otherwise.

setPrimaryKey

public void setPrimaryKey(boolean isPrimaryKey)
Sets the primary key property of this column.

Parameters:
isPrimaryKey - true if column is a primary key.

getName

public java.lang.String getName()
Description copied from interface: ColumnMetaData
Returns the name of the column.

Specified by:
getName in interface ColumnMetaData
Returns:
name.

getFullName

public java.lang.String getFullName()
Description copied from interface: ColumnMetaData
Returns the full name of the column.

Specified by:
getFullName in interface ColumnMetaData
Returns:
full name of the column.

getTable

public TableMetaData getTable()
Description copied from interface: ColumnMetaData
Returns the table that this column belongs to.

Specified by:
getTable in interface ColumnMetaData
Returns:
table meta data.

getPosition

public int getPosition()
Description copied from interface: ColumnMetaData
Returns the ordinal position (column number) of this column in the table.

Specified by:
getPosition in interface ColumnMetaData
Returns:
column number.

getDataType

public int getDataType()
Description copied from interface: ColumnMetaData
Returns the java type of the column.

Specified by:
getDataType in interface ColumnMetaData
Returns:
Java type of this column.

getSQLType

public java.lang.String getSQLType()
Description copied from interface: ColumnMetaData
Returns the SQL type of this column.

Specified by:
getSQLType in interface ColumnMetaData
Returns:
SQL type.

getColumnSize

public int getColumnSize()
Description copied from interface: ColumnMetaData
Returns the column size.

Specified by:
getColumnSize in interface ColumnMetaData
Returns:
column size.

getDecimalDigits

public int getDecimalDigits()
Description copied from interface: ColumnMetaData
Returns the number of decimal digits in this column if the column type is a numerical type.

Specified by:
getDecimalDigits in interface ColumnMetaData
Returns:
number of decimal digits or -1 if this operation is not applicable to the column type.

isNullable

public boolean isNullable()
Description copied from interface: ColumnMetaData
Indicates whether this column can contain NULL values.

Specified by:
isNullable in interface ColumnMetaData
Returns:
true if the column is nullable, false otherwise.

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: ColumnMetaData
Returns the primary key property of this column

Specified by:
isPrimaryKey in interface ColumnMetaData
Returns:
true if this columns forms part of the primary key.