net.sourceforge.jdbdump.dump
Class Column

java.lang.Object
  extended by net.sourceforge.jdbdump.dump.Column
All Implemented Interfaces:
java.io.Serializable

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

Represents a single column of a table in the database, with all its parameters.

Author:
jsuder
See Also:
Serialized Form

Constructor Summary
Column(java.lang.String name)
          Creates a new table column with specified name.
 
Method Summary
 Constraint getConstraint()
          Returns this column's constraint (e.g.
 int getDecimalDigits()
          Returns the number of possible digits after a dot/comma, if the column stores decimal numbers.
 java.lang.String getDefault()
          Returns the default value used for column's fields if no value is specified.
 int getLength()
          Returns the column's length in characters.
 java.lang.String getName()
          Returns the column's name.
 int getNullable()
          Tells if NULL values are allowed to be stored in this column.
 java.lang.String getNullable2()
          Tells if NULL values are allowed to be stored in this column.
 java.lang.String getRemarks()
          Returns the column's remarks, i.e.
 java.lang.String getType()
          Returns the column's type name.
 void setConstraint(Constraint constraint)
          Assigns a constraint to this table column.
 void setDecimalDigits(int decimalDigits)
          Sets the number of column's decimal digits.
 void setDefault(java.lang.String defaultValue)
          Sets the column's default value.
 void setLength(int length)
          Sets the column's length in characters.
 void setName(java.lang.String name)
          Sets the column's name.
 void setNullable(int nullable)
          Sets the column's nullability (DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable or DatabaseMetaData.columnNullableUnknown).
 void setNullable2(java.lang.String nullable2)
          Sets the column's nullability ("YES", "NO" or "").
 void setRemarks(java.lang.String remarks)
          Sets the column's remarks.
 void setType(java.lang.String type)
          Sets the column's type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Column

public Column(java.lang.String name)
Creates a new table column with specified name.

Parameters:
name - column name
Method Detail

getName

public java.lang.String getName()
Returns the column's name.

Returns:
column name

setName

public void setName(java.lang.String name)
Sets the column's name.

Parameters:
name - new column name

getType

public java.lang.String getType()
Returns the column's type name.

Returns:
column type

setType

public void setType(java.lang.String type)
Sets the column's type.

Parameters:
type - new column type name

getLength

public int getLength()
Returns the column's length in characters.

Returns:
column length

setLength

public void setLength(int length)
Sets the column's length in characters.

Parameters:
length - column length

getDecimalDigits

public int getDecimalDigits()
Returns the number of possible digits after a dot/comma, if the column stores decimal numbers.

Returns:
number of characters reserved for decimal digits

setDecimalDigits

public void setDecimalDigits(int decimalDigits)
Sets the number of column's decimal digits.

Parameters:
decimalDigits - number of column's decimal digits

getNullable

public int getNullable()
Tells if NULL values are allowed to be stored in this column. Possible values: See also: getNullable2().

Returns:
a constant specifying if the field is nullable

setNullable

public void setNullable(int nullable)
Sets the column's nullability (DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable or DatabaseMetaData.columnNullableUnknown).

Parameters:
nullable - a constant specifying column's nullability

getNullable2

public java.lang.String getNullable2()
Tells if NULL values are allowed to be stored in this column. Possible values: See also: getNullable().

Returns:
a string specifying if the field is nullable

setNullable2

public void setNullable2(java.lang.String nullable2)
Sets the column's nullability ("YES", "NO" or "").

Parameters:
nullable2 - a string specifying column's nullability

getDefault

public java.lang.String getDefault()
Returns the default value used for column's fields if no value is specified.

Returns:
column fields' default value

setDefault

public void setDefault(java.lang.String defaultValue)
Sets the column's default value.

Parameters:
defaultValue - column's new default value

getRemarks

public java.lang.String getRemarks()
Returns the column's remarks, i.e. some non-standard keywords. For example, for MySQL it can be "auto_increment".

Returns:
column's remarks

setRemarks

public void setRemarks(java.lang.String remarks)
Sets the column's remarks.

Parameters:
name - column's new remarks string

setConstraint

public void setConstraint(Constraint constraint)
Assigns a constraint to this table column.

Parameters:
a - constraint to be set as this column's constraint

getConstraint

public Constraint getConstraint()
Returns this column's constraint (e.g. PRIMARY KEY, or CHECK).

Returns:
a constraint assigned to this column


Copyright © 2005-2006 AGH International University of Science and Technology. All Rights Reserved.