com.jgpruitt.datamodeler.core
Class Column

java.lang.Object
  extended by com.jgpruitt.datamodeler.core.Column

public class Column
extends java.lang.Object

This class models a column in a database table.

Author:
John Pruitt

Field Summary
protected  java.lang.String comment
           
protected  DataType dataType
           
protected  java.lang.Integer increment
           
protected  boolean isNullable
           
protected  java.lang.Integer length
           
protected  java.lang.String name
           
protected  java.lang.Integer precision
           
protected  java.lang.Integer scale
           
protected  java.lang.Integer seed
           
protected  Table table
           
 
Constructor Summary
Column(java.lang.String name)
          Constructor.
 
Method Summary
 java.lang.String getComment()
          Getter for the comment.
 DataType getDataType()
          Getter for the Column's DataType.
 java.lang.Integer getIncrement()
          Getter for the increment.
 java.lang.Integer getLength()
          Getter for the length.
 java.lang.String getName()
          Getter for the Column name.
 java.lang.Integer getPrecision()
          Getter for the precision.
 java.lang.Integer getScale()
          Getter for the scale.
 java.lang.Integer getSeed()
          Getter for the seed.
 Table getTable()
          Getter for the Table to which the Column belongs.
 boolean isNullable()
          Does the Column accept NULL values?
 void setComment(java.lang.String comment)
          Setter for the comment.
 void setDataType(DataType dataType)
          Setter for the Column's DataType.
 void setIncrement(java.lang.Integer increment)
          Setter for the increment.
 void setLength(java.lang.Integer length)
          Setter for the length.
 void setNullable(boolean nullable)
          Setter for the isNullable field.
 void setPrecision(java.lang.Integer precision)
          Setter for the precision.
 void setScale(java.lang.Integer scale)
          Setter for the scale.
 void setSeed(java.lang.Integer seed)
          Setter for the seed.
 void setTable(Table table)
          Setter for the Table to which the Column belongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final java.lang.String name

table

protected Table table

dataType

protected DataType dataType

isNullable

protected boolean isNullable

length

protected java.lang.Integer length

precision

protected java.lang.Integer precision

scale

protected java.lang.Integer scale

seed

protected java.lang.Integer seed

increment

protected java.lang.Integer increment

comment

protected java.lang.String comment
Constructor Detail

Column

public Column(java.lang.String name)
Constructor.

Parameters:
name - The name of the column. The column name must not be null or empty.
Method Detail

getName

public java.lang.String getName()
Getter for the Column name.

Returns:
The name of the column.

getTable

public Table getTable()
Getter for the Table to which the Column belongs.

Returns:
Returns the Table to which this Column belongs.
See Also:
Table

setTable

public void setTable(Table table)
Setter for the Table to which the Column belongs.

Parameters:
table - The Table to which the Column belongs.
See Also:
Table

getDataType

public DataType getDataType()
Getter for the Column's DataType.

Returns:
The DataType of the Column.
See Also:
DataType

setDataType

public void setDataType(DataType dataType)
Setter for the Column's DataType.

Parameters:
dataType - The DataType of the Column.
See Also:
DataType

isNullable

public boolean isNullable()
Does the Column accept NULL values?

Returns:
Returns true if the Column accepts NULL values.

setNullable

public void setNullable(boolean nullable)
Setter for the isNullable field.

Parameters:
nullable - true if the Column should accept NULL values, false otherwise.

getLength

public java.lang.Integer getLength()
Getter for the length. Getter for the length. This only applies to Columns of a certain DataType.

Returns:
the length of the Column's DataType or null.
See Also:
DataType

setLength

public void setLength(java.lang.Integer length)
Setter for the length. Setter for the length. This only applies to Columns of a certain DataType.

Parameters:
length - The length of the DataType.
See Also:
DataType

getPrecision

public java.lang.Integer getPrecision()
Getter for the precision. Gets the precision of the datatype of the Column. This only applies to certain DataTypes.

Returns:
the precision of the DataType or null.
See Also:
DataType

setPrecision

public void setPrecision(java.lang.Integer precision)
Setter for the precision. Sets the precision of the datatype of the Column. This only applies to certain DataTypes.

Parameters:
precision - the precision of the DataType
See Also:
DataType

getScale

public java.lang.Integer getScale()
Getter for the scale. Gets the scale of the datatype of the Column. This only applies to certain DataTypes.

Returns:
The scale of the datatype of the Column or null
See Also:
DataType

setScale

public void setScale(java.lang.Integer scale)
Setter for the scale. Sets the scale of the datatype of the Column. This only applies to certain DataTypes.

Parameters:
scale - The scale of the datatype of the Column.
See Also:
DataType

getSeed

public java.lang.Integer getSeed()
Getter for the seed. The seed is used for autoincremented columns on some platforms. It is the first value used in the sequence.

Returns:
The seed value or null.
See Also:
DataType

setSeed

public void setSeed(java.lang.Integer seed)
Setter for the seed. The seed is used for autoincremented columns on some platforms. It is the first value used in the sequence.

Parameters:
seed - The seed value.
See Also:
DataType

getIncrement

public java.lang.Integer getIncrement()
Getter for the increment. The increment is used for autoincremented columns on some platforms. It is the value by which the sequence advances.

Returns:
The increment value or null.
See Also:
DataType

setIncrement

public void setIncrement(java.lang.Integer increment)
Setter for the increment. The increment is used for autoincremented columns on some platforms. It is the value by which the sequence advances.

Parameters:
increment - The increment value or null.
See Also:
DataType

getComment

public java.lang.String getComment()
Getter for the comment. The comment used for the Column's metadata in the data dictionary.

Returns:
the comment.
See Also:
DataType

setComment

public void setComment(java.lang.String comment)
Setter for the comment. Sets the comment used for the Column's metadata in the data dictionary.

Parameters:
comment - the comment to be used in the data dictionary.
See Also:
DataType