atg.rview
Class ColumnDeclaration

java.lang.Object
  extended by atg.rview.ColumnDeclaration

public class ColumnDeclaration
extends java.lang.Object

This represents the declaration of a column, to be used as part of a TableDeclaration object.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
ColumnDeclaration(java.lang.String pName, int pType)
          Constructs a new ColumnDeclaration
ColumnDeclaration(java.lang.String pName, int pType, int pSize)
          Constructs a new ColumnDeclaration
 
Method Summary
 java.lang.String getAdditionalConstraints()
          Returns any additional, possibly database-dependent constraints for the column.
static java.lang.String getJDBCTypeName(int pType)
          Returns the name of the JDBC type corresponding to the type specified from java.sql.Types
 java.lang.String getName()
          Returns the name of the column
 int getSize()
          Returns the size of the column
 int getType()
          Returns the type of the column taken from java.sql.Types
 boolean isNotNull()
          Returns true if the NOT NULL constraint was added to the column.
 boolean isNull()
          Returns true if the NULL constraint was added to the column.
 boolean isPrimaryKey()
          Returns true if the PRIMARY KEY constraint was added to the column.
 boolean isSizeDeclared()
          Returns true is a size was declared for the column
 boolean isUnique()
          Returns true if the UNIQUE constraint was added to the column.
 ColumnDeclaration withAdditionalConstraints(java.lang.String pAdditionalConstraints)
          Adds any other additional constraints to the column that are passed directly to the CREATE TABLE statement.
 ColumnDeclaration withNotNull()
          Adds the NOT NULL constraint to the column.
 ColumnDeclaration withNull()
          Adds the NULL constraint to the column.
 ColumnDeclaration withPrimaryKey()
          Adds the PRIMARY KEY constraint to the column.
 ColumnDeclaration withSize(int pSize)
          Sets the size of the column.
 ColumnDeclaration withUnique()
          Adds the UNIQUE constraint to the column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ColumnDeclaration

public ColumnDeclaration(java.lang.String pName,
                         int pType)
Constructs a new ColumnDeclaration

Parameters:
pName - the name of the column
pType - the SQL type as taken from java.sql.Types

ColumnDeclaration

public ColumnDeclaration(java.lang.String pName,
                         int pType,
                         int pSize)
Constructs a new ColumnDeclaration

Parameters:
pName - the name of the column
pType - the SQL type as taken from java.sql.Types
pSize - the size of the column, for variable-length types
Method Detail

withSize

public ColumnDeclaration withSize(int pSize)
Sets the size of the column. Returns this.


withNull

public ColumnDeclaration withNull()
Adds the NULL constraint to the column. Returns this.


withNotNull

public ColumnDeclaration withNotNull()
Adds the NOT NULL constraint to the column. Returns this.


withUnique

public ColumnDeclaration withUnique()
Adds the UNIQUE constraint to the column. Returns this.


withPrimaryKey

public ColumnDeclaration withPrimaryKey()
Adds the PRIMARY KEY constraint to the column. Returns this.


withAdditionalConstraints

public ColumnDeclaration withAdditionalConstraints(java.lang.String pAdditionalConstraints)
Adds any other additional constraints to the column that are passed directly to the CREATE TABLE statement. These may be database-dependent. Returns this.


getName

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


getType

public int getType()
Returns the type of the column taken from java.sql.Types


getSize

public int getSize()
Returns the size of the column


isSizeDeclared

public boolean isSizeDeclared()
Returns true is a size was declared for the column


isNull

public boolean isNull()
Returns true if the NULL constraint was added to the column.


isNotNull

public boolean isNotNull()
Returns true if the NOT NULL constraint was added to the column.


isUnique

public boolean isUnique()
Returns true if the UNIQUE constraint was added to the column.


isPrimaryKey

public boolean isPrimaryKey()
Returns true if the PRIMARY KEY constraint was added to the column.


getAdditionalConstraints

public java.lang.String getAdditionalConstraints()
Returns any additional, possibly database-dependent constraints for the column. Returns null if there are none.


getJDBCTypeName

public static java.lang.String getJDBCTypeName(int pType)
Returns the name of the JDBC type corresponding to the type specified from java.sql.Types