public class Column extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Column.AutoIncrement
Enumeration for valid auto-increment values provided by JDBC driver implementations.
|
static class |
Column.Nullable
Specifies nullable usage.
|
Modifier and Type | Field and Description |
---|---|
static Column.Nullable |
NO_NULLS
Indicates that the column might not allow
NULL values. |
static Column.Nullable |
NULLABLE
Indicates that the column definitely allows
NULL values. |
static Column.Nullable |
NULLABLE_UNKNOWN
Indicates that the nullability of columns is unknown.
|
Constructor and Description |
---|
Column(String columnName,
DataType dataType)
Creates a Column object.
|
Column(String columnName,
DataType dataType,
Column.Nullable nullable)
Creates a Column object.
|
Column(String columnName,
DataType dataType,
String sqlTypeName,
Column.Nullable nullable)
Creates a Column object.
|
Column(String columnName,
DataType dataType,
String sqlTypeName,
Column.Nullable nullable,
String defaultValue)
Creates a Column object.
|
Column(String columnName,
DataType dataType,
String sqlTypeName,
Column.Nullable nullable,
String defaultValue,
String remarks,
Column.AutoIncrement autoIncrement)
Creates a Column object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Column.AutoIncrement |
getAutoIncrement() |
String |
getColumnName()
Returns this column name.
|
DataType |
getDataType()
Returns this column data type.
|
String |
getDefaultValue() |
Column.Nullable |
getNullable()
Returns
true if this column is nullable. |
String |
getRemarks() |
String |
getSqlTypeName()
Returns this column sql data type name.
|
int |
hashCode() |
static Column.Nullable |
nullableValue(boolean nullable)
Returns the appropriate Nullable constant.
|
static Column.Nullable |
nullableValue(int nullable)
Returns the appropriate Nullable constant according specified JDBC
DatabaseMetaData constant.
|
String |
toString() |
public static final Column.Nullable NO_NULLS
NULL
values.public static final Column.Nullable NULLABLE
NULL
values.public static final Column.Nullable NULLABLE_UNKNOWN
public Column(String columnName, DataType dataType)
columnName
- the column namedataType
- the data typepublic Column(String columnName, DataType dataType, Column.Nullable nullable)
public Column(String columnName, DataType dataType, String sqlTypeName, Column.Nullable nullable)
public Column(String columnName, DataType dataType, String sqlTypeName, Column.Nullable nullable, String defaultValue)
columnName
- The name of the columndataType
- The DbUnit DataType
of the columnsqlTypeName
- The SQL name of the column which comes from the JDBC driver.
See value 'TYPE_NAME' in DatabaseMetaData.getColumns(String, String, String, String)
nullable
- whether or not the column is nullabledefaultValue
- The default value on the DB for this column. Can be null
.public Column(String columnName, DataType dataType, String sqlTypeName, Column.Nullable nullable, String defaultValue, String remarks, Column.AutoIncrement autoIncrement)
columnName
- The name of the columndataType
- The DbUnit DataType
of the columnsqlTypeName
- The SQL name of the column which comes from the JDBC driver.
See value 'TYPE_NAME' in DatabaseMetaData.getColumns(String, String, String, String)
nullable
- whether or not the column is nullabledefaultValue
- The default value on the DB for this column. Can be null
.remarks
- The remarks on the DB for this column. Can be null
.autoIncrement
- The auto increment setting for this column. Can be null
.public String getColumnName()
public DataType getDataType()
public String getSqlTypeName()
public Column.Nullable getNullable()
true
if this column is nullable.public String getDefaultValue()
public String getRemarks()
public Column.AutoIncrement getAutoIncrement()
public static Column.Nullable nullableValue(int nullable)
nullable
- one of the following constants
DatabaseMetaData.columnNoNulls
,
DatabaseMetaData.columnNullable
,
DatabaseMetaData.columnNullableUnknown
public static Column.Nullable nullableValue(boolean nullable)
nullable
- true
if null is allowedCopyright © 2002–2017. All rights reserved.