Interface Column
- All Known Implementing Classes:
ColumnImpl
public interface Column
Interface representing a column in a table.
-
Method Summary
Modifier and TypeMethodDescriptionAccessor for the metadata for this column (if any).Accessor for the role that this column serves (if known).Accessor for the default ValueAccessor for the JDBC Type used for this column.Accessor for the mapping (and hence member) that owns this column.getName()
Accessor for the column name.int
Accessor for the position of this column in the table (if specified).getTable()
Accessor for the table for this column.Accessor for the native type name in the datastore for this column.boolean
Accessor for whether the column is defaultable.boolean
Accessor for whether the column is nullable in the datastore.boolean
Whether this column is (part of) the primary keyboolean
isUnique()
Accessor for whether the column is unique.setDefaultable
(Object defaultValue) Mutator for the defaultability of the column.setJdbcType
(JdbcType jdbcType) setNullable
(boolean nullable) Mutator for the nullability of the column.setPosition
(int pos) Mutator to make the column (part of) the primary key.setTypeName
(String type) setUnique
(boolean unique) Mutator for the uniqueness of the column.
-
Method Details
-
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
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
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
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
-
setJdbcType
-
getJdbcType
JdbcType getJdbcType()Accessor for the JDBC Type used for this column.- Returns:
- The Jdbc type
-
setTypeName
-
getTypeName
String getTypeName()Accessor for the native type name in the datastore for this column.- Returns:
- The column type name
-
setPosition
-
getPosition
int getPosition()Accessor for the position of this column in the table (if specified).- Returns:
- The position, or -1 if not specified
-
setColumnMetaData
-
getColumnMetaData
ColumnMetaData getColumnMetaData()Accessor for the metadata for this column (if any).- Returns:
- Metadata for the column
-