org.apache.torque.map
Class ColumnMap

java.lang.Object
  extended byorg.apache.torque.map.ColumnMap
All Implemented Interfaces:
java.io.Serializable

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

ColumnMap is used to model a column of a table in a database.

Version:
$Id: ColumnMap.java,v 1.7.2.2 2004/05/20 04:36:07 seade Exp $
Author:
John D. McNally
See Also:
Serialized Form

Constructor Summary
ColumnMap(java.lang.String name, TableMap containingTable)
          Constructor.
 
Method Summary
 java.lang.String getColumnName()
          Get the name of a column.
 java.lang.String getFullyQualifiedName()
          Get the table name + column name.
 java.lang.String getRelatedColumnName()
          Get the column name that this column is related to.
 java.lang.String getRelatedName()
          Get the table.column that this column is related to.
 java.lang.String getRelatedTableName()
          Get the table name that this column is related to.
 int getSize()
          Get the size of this column.
 java.lang.String getTableName()
          Get the name of the table this column is in.
 java.lang.Object getType()
          Get the type of this column.
 boolean isForeignKey()
          Is this column a foreign key?
 boolean isNotNull()
          Is null value allowed ?
 boolean isPrimaryKey()
          Is this column a primary key?
 void setForeignKey(java.lang.String fullyQualifiedName)
          Set the foreign key for this column.
 void setForeignKey(java.lang.String tableName, java.lang.String columnName)
          Set the foreign key for this column.
 void setNotNull(boolean nn)
          Set if this column may be null.
 void setPrimaryKey(boolean pk)
          Set if this column is a primary key or not.
 void setSize(int size)
          Set the size of this column.
 void setType(java.lang.Object type)
          Set the type of this column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnMap

public ColumnMap(java.lang.String name,
                 TableMap containingTable)
Constructor.

Parameters:
name - The name of the column.
containingTable - TableMap of the table this column is in.
Method Detail

getColumnName

public java.lang.String getColumnName()
Get the name of a column.

Returns:
A String with the column name.

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Get the table name + column name.

Returns:
A String with the full column name.

getTableName

public java.lang.String getTableName()
Get the name of the table this column is in.

Returns:
A String with the table name.

setType

public void setType(java.lang.Object type)
Set the type of this column.

Parameters:
type - An Object specifying the type.

setSize

public void setSize(int size)
Set the size of this column.

Parameters:
size - An int specifying the size.

setPrimaryKey

public void setPrimaryKey(boolean pk)
Set if this column is a primary key or not.

Parameters:
pk - True if column is a primary key.

setNotNull

public void setNotNull(boolean nn)
Set if this column may be null.

Parameters:
nn - True if column may be null.

setForeignKey

public void setForeignKey(java.lang.String fullyQualifiedName)
Set the foreign key for this column.

Parameters:
fullyQualifiedName - The name of the table.column that is foreign.

setForeignKey

public void setForeignKey(java.lang.String tableName,
                          java.lang.String columnName)
Set the foreign key for this column.

Parameters:
tableName - The name of the table that is foreign.
columnName - The name of the column that is foreign.

getType

public java.lang.Object getType()
Get the type of this column.

Returns:
An Object specifying the type.

getSize

public int getSize()
Get the size of this column.

Returns:
An int specifying the size.

isPrimaryKey

public boolean isPrimaryKey()
Is this column a primary key?

Returns:
True if column is a primary key.

isNotNull

public boolean isNotNull()
Is null value allowed ?

Returns:
True if column may be null.

isForeignKey

public boolean isForeignKey()
Is this column a foreign key?

Returns:
True if column is a foreign key.

getRelatedName

public java.lang.String getRelatedName()
Get the table.column that this column is related to.

Returns:
A String with the full name for the related column.

getRelatedTableName

public java.lang.String getRelatedTableName()
Get the table name that this column is related to.

Returns:
A String with the name for the related table.

getRelatedColumnName

public java.lang.String getRelatedColumnName()
Get the column name that this column is related to.

Returns:
A String with the name for the related column.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.