| java.lang.Object org.openharmonise.commons.dsi.ddl.ColumnDefinition
ColumnDefinition | public class ColumnDefinition (Code) | | An abstraction of a databse table column.
author: Michael Bell version: $Revision: 1.1 $ |
Field Summary | |
public static int | BOOLEAN Constant indicating a boolean data type. | public static int | DATE Constant indicating a date data type. | public static int | LONG_TEXT Constant indicating a long text data type. | public static int | NUMBER Constant indicating a number data type. | public static int | TEXT Constant indicating a text data type. | boolean | m_bAllowNull boolean flag to indicate whether column can be NULL. | boolean | m_bIsPrimaryKey boolean flag to indicate whether column is a primary key. | boolean | m_bIsUnique boolean flag to indicate whether column value has to be unique. | Object | m_default Default value for column. | String | m_sForeignKeyRef The table name that this column references as a foreign key. |
Constructor Summary | |
public | ColumnDefinition(String sColName, int nDataType) Creates a column definition for a column with the given name
and datatype. | public | ColumnDefinition(String sColName, int nDataType, boolean bAllowNull) Creates a column definition for a column with the given name
,datatype and whether the column can be NULL. | public | ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType) Creates a column definition for a column. | public | ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType, boolean bAllowNull) Creates a column definition for a column. | public | ColumnDefinition(String sColName, int nDataType, Object defaultVal) Creates a column definition for a column. | public | ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType, Object defaultVal) Creates a column definition for a column. |
Method Summary | |
public void | addForeignKey(String sForeignKeyRef) Adds a foreign key reference . | public boolean | allowNulls() Returns true if the column can have NULL values. | public int | getDataType() Returns the data type. | public Object | getDefault() Returns the default value for the column. | public String | getForeignKeyReference() Returns the table name of the foreign key reference. | public String | getName() Returns the column name. | public boolean | isForeignKey() Returns true if the column is/has a foreign key. | public boolean | isPrimaryKey() Returns true if the column is a primary key. | public boolean | isUnique() Returns true if the column values must be unique. | public void | setIsUnique(boolean bIsUnique) Sets whether the column values must be unique. |
BOOLEAN | public static int BOOLEAN(Code) | | Constant indicating a boolean data type.
|
DATE | public static int DATE(Code) | | Constant indicating a date data type.
|
LONG_TEXT | public static int LONG_TEXT(Code) | | Constant indicating a long text data type.
|
NUMBER | public static int NUMBER(Code) | | Constant indicating a number data type.
|
TEXT | public static int TEXT(Code) | | Constant indicating a text data type.
|
m_bAllowNull | boolean m_bAllowNull(Code) | | boolean flag to indicate whether column can be NULL.
|
m_bIsPrimaryKey | boolean m_bIsPrimaryKey(Code) | | boolean flag to indicate whether column is a primary key.
|
m_bIsUnique | boolean m_bIsUnique(Code) | | boolean flag to indicate whether column value has to be unique.
|
m_sForeignKeyRef | String m_sForeignKeyRef(Code) | | The table name that this column references as a foreign key.
|
ColumnDefinition | public ColumnDefinition(String sColName, int nDataType)(Code) | | Creates a column definition for a column with the given name
and datatype.
Parameters: sColName - the column name Parameters: nDataType - the data type |
ColumnDefinition | public ColumnDefinition(String sColName, int nDataType, boolean bAllowNull)(Code) | | Creates a column definition for a column with the given name
,datatype and whether the column can be NULL.
Parameters: sColName - the column name Parameters: nDataType - the data type Parameters: bAllowNull - true if the column can be NULL |
ColumnDefinition | public ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType)(Code) | | Creates a column definition for a column.
Parameters: sColName - the column name Parameters: bIsPrimaryKey - true if the column is a primary key Parameters: nDataType - the data type |
ColumnDefinition | public ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType, boolean bAllowNull)(Code) | | Creates a column definition for a column.
Parameters: sColName - the column name Parameters: bIsPrimaryKey - true if the column is a primary key Parameters: nDataType - the data type Parameters: bAllowNull - true if the column can be NULL |
ColumnDefinition | public ColumnDefinition(String sColName, int nDataType, Object defaultVal)(Code) | | Creates a column definition for a column.
Parameters: sColName - the column name Parameters: nDataType - the data type Parameters: defaultVal - the default value |
ColumnDefinition | public ColumnDefinition(String sColName, boolean bIsPrimaryKey, int nDataType, Object defaultVal)(Code) | | Creates a column definition for a column.
Parameters: sColName - the column name Parameters: bIsPrimaryKey - true if the column is a primary key Parameters: nDataType - the data type Parameters: defaultVal - the default value |
addForeignKey | public void addForeignKey(String sForeignKeyRef)(Code) | | Adds a foreign key reference .
Parameters: string - the table name of the foreign key reference |
allowNulls | public boolean allowNulls()(Code) | | Returns true if the column can have NULL values.
true if the column can have NULL values |
getDataType | public int getDataType()(Code) | | Returns the data type.
the data type |
getDefault | public Object getDefault()(Code) | | Returns the default value for the column.
the default value for the column |
getForeignKeyReference | public String getForeignKeyReference()(Code) | | Returns the table name of the foreign key reference.
the foreign key reference |
getName | public String getName()(Code) | | Returns the column name.
the column name |
isForeignKey | public boolean isForeignKey()(Code) | | Returns true if the column is/has a foreign key.
true if the column is/has a foreign key |
isPrimaryKey | public boolean isPrimaryKey()(Code) | | Returns true if the column is a primary key.
true if the column is a primary key |
isUnique | public boolean isUnique()(Code) | | Returns true if the column values must be unique.
true if the column values must be unique |
setIsUnique | public void setIsUnique(boolean bIsUnique)(Code) | | Sets whether the column values must be unique.
Parameters: bIsUnique - true if the column values must be unique |
|
|