com.redhat.persistence.metadata
Class Column

java.lang.Object
  extended bycom.redhat.persistence.metadata.Element
      extended bycom.redhat.persistence.metadata.Column

public class Column
extends com.redhat.persistence.metadata.Element

The Column class is used to keep information about the physical schema in the database.

Version:
$Revision: #10 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu

Field Summary
static String versionId
           
 
Constructor Summary
Column(String columnName)
          Constructs a new Column with the given table and columnName.
Column(String columnName, int type)
          Constructs a new Column with the given table, columnName, and JDBC integer type code.
Column(String columnName, int type, int size)
          Constructs a new column with the given columnName, type and size.
Column(String columnName, int type, int size, int scale)
          Constructs a new Column with the given table, columnName, JDBC integer type code, and size.
Column(String name, int type, int size, int scale, boolean isNullable)
          Constructs a new Column with the given table, columnName, JDBC integer type code, and size.
 
Method Summary
 String getColumnName()
          Returns the name of this Column.
 String getName()
          Returns the name of this Column.
 String getQualifiedName()
           
 int getScale()
           
 int getSize()
          This returns the size of the column
 String getSQL()
           
 Table getTable()
          Returns the table that this Column belongs to.
 String getTableName()
          Returns the name of the table that this Column belongs to.
 int getType()
          Returns the type of this Column.
static String getTypeName(int type)
           
 boolean isForeignKey()
           
 boolean isNullable()
           
 boolean isPrimaryKey()
           
 boolean isUniqueKey()
           
 void setNullable(boolean value)
           
 void setScale(int scale)
           
 void setSize(int size)
           
 void setType(int type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Column

public Column(String columnName)
Constructs a new Column with the given table and columnName.

Parameters:
columnName - The name of this Column.

Column

public Column(String columnName,
              int type)
Constructs a new Column with the given table, columnName, and JDBC integer type code.

Parameters:
columnName - The name of this Column.
type - The JDBC integer type code for this Column.

Column

public Column(String columnName,
              int type,
              int size)
Constructs a new column with the given columnName, type and size.

Parameters:
columnName - The name of this Column.
type - The JDBC integer type code for this Column.
size - The size of this Column.

Column

public Column(String columnName,
              int type,
              int size,
              int scale)
Constructs a new Column with the given table, columnName, JDBC integer type code, and size.

Parameters:
columnName - The name of this Column.
type - The JDBC integer type code for this Column.
size - The size of this Column.

Column

public Column(String name,
              int type,
              int size,
              int scale,
              boolean isNullable)
Constructs a new Column with the given table, columnName, JDBC integer type code, and size.

Parameters:
name - The name of this Column.
type - The JDBC integer type code for this Column.
size - The size of this Column.
scale - The scale of this Column.
isNullable - True if the column is nullable.
Method Detail

getTable

public Table getTable()
Returns the table that this Column belongs to.

Returns:
The table that this Column belongs to.

getName

public String getName()
Returns the name of this Column.

Returns:
The name of this Column.

getTableName

public String getTableName()
Returns the name of the table that this Column belongs to.

Returns:
The name of the table that this Column belongs to.

getColumnName

public String getColumnName()
Returns the name of this Column.

Returns:
The name of this Column.

isNullable

public boolean isNullable()

setNullable

public void setNullable(boolean value)

getType

public int getType()
Returns the type of this Column.

Returns:
The type of this Column.

setType

public void setType(int type)

getQualifiedName

public String getQualifiedName()
Returns:
the table name and the column name, joined by a period.

isPrimaryKey

public boolean isPrimaryKey()

isUniqueKey

public boolean isUniqueKey()

isForeignKey

public boolean isForeignKey()

getTypeName

public static String getTypeName(int type)

getSize

public int getSize()
This returns the size of the column


setSize

public void setSize(int size)

getScale

public int getScale()

setScale

public void setScale(int scale)

getSQL

public String getSQL()

toString

public String toString()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC