Interface Column
-
- All Known Implementing Classes:
ColumnImpl
public interface ColumnInterface representing a column in a table.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ColumnMetaDatagetColumnMetaData()Accessor for the metadata for this column (if any).ColumnTypegetColumnType()Accessor for the role that this column serves (if known).ObjectgetDefaultValue()Accessor for the default ValueJdbcTypegetJdbcType()Accessor for the JDBC Type used for this column.MemberColumnMappinggetMemberColumnMapping()Accessor for the mapping (and hence member) that owns this column.StringgetName()Accessor for the column name.intgetPosition()Accessor for the position of this column in the table (if specified).TablegetTable()Accessor for the table for this column.StringgetTypeName()Accessor for the native type name in the datastore for this column.booleanisDefaultable()Accessor for whether the column is defaultable.booleanisNullable()Accessor for whether the column is nullable in the datastore.booleanisPrimaryKey()Whether this column is (part of) the primary keybooleanisUnique()Accessor for whether the column is unique.ColumnsetColumnMetaData(ColumnMetaData md)ColumnsetDefaultable(Object defaultValue)Mutator for the defaultability of the column.ColumnsetJdbcType(JdbcType jdbcType)ColumnsetNullable(boolean nullable)Mutator for the nullability of the column.ColumnsetPosition(int pos)ColumnsetPrimaryKey()Mutator to make the column (part of) the primary key.ColumnsetTypeName(String type)ColumnsetUnique(boolean unique)Mutator for the uniqueness of the column.
-
-
-
Method Detail
-
getName
String getName()
Accessor for the column name.- Returns:
- Name of column
-
getTable
Table getTable()
Accessor for the table for this column.- Returns:
- The table
-
getMemberColumnMapping
MemberColumnMapping getMemberColumnMapping()
Accessor for the mapping (and hence member) that owns this column.- Returns:
- The associated mapping (or null if this is a surrogate column)
-
isPrimaryKey
boolean isPrimaryKey()
Whether this column is (part of) the primary key- Returns:
- Whether part of the PK
-
setPrimaryKey
Column setPrimaryKey()
Mutator to make the column (part of) the primary key.- Returns:
- This column
-
setNullable
Column setNullable(boolean nullable)
Mutator for the nullability of the column.- Parameters:
nullable- Whether this is nullable- Returns:
- The column with the updated info
-
isNullable
boolean isNullable()
Accessor for whether the column is nullable in the datastore.- Returns:
- whether the column is nullable
-
setDefaultable
Column setDefaultable(Object defaultValue)
Mutator for the defaultability of the column.- Parameters:
defaultValue- The default to use- Returns:
- The column with the updated info
-
isDefaultable
boolean isDefaultable()
Accessor for whether the column is defaultable.- Returns:
- whether the column is defaultable
-
getDefaultValue
Object getDefaultValue()
Accessor for the default Value- Returns:
- the default value
-
setUnique
Column setUnique(boolean unique)
Mutator for the uniqueness of the column.- Parameters:
unique- The flag- Returns:
- The column with the updated info
-
isUnique
boolean isUnique()
Accessor for whether the column is unique.- Returns:
- whether the column is unique
-
getColumnType
ColumnType getColumnType()
Accessor for the role that this column serves (if known).- Returns:
- Role of the column
-
getJdbcType
JdbcType getJdbcType()
Accessor for the JDBC Type used for this column.- Returns:
- The Jdbc type
-
getTypeName
String getTypeName()
Accessor for the native type name in the datastore for this column.- Returns:
- The column type name
-
setPosition
Column setPosition(int pos)
-
getPosition
int getPosition()
Accessor for the position of this column in the table (if specified).- Returns:
- The position, or -1 if not specified
-
setColumnMetaData
Column setColumnMetaData(ColumnMetaData md)
-
getColumnMetaData
ColumnMetaData getColumnMetaData()
Accessor for the metadata for this column (if any).- Returns:
- Metadata for the column
-
-