Package io.debezium.relational
Interface Column
-
- All Superinterfaces:
Comparable<Column>
- All Known Implementing Classes:
ColumnImpl
@Immutable public interface Column extends Comparable<Column>
An immutable definition of a column.- Author:
- Randall Hauch
- See Also:
Table
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNSET_INT_VALUE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
charsetName()
Get the database-specific name of the character set used by this column.default int
compareTo(Column that)
Object
defaultValue()
Get the default value of the columnColumnEditor
edit()
Obtain an editor that contains the same information as this column definition.static ColumnEditor
editor()
Obtain an column definition editor that can be used to define a column.List<String>
enumValues()
Get the list of values associated with the enumboolean
hasDefaultValue()
Determine whether this column's has a default valueboolean
isAutoIncremented()
Determine whether this column's values are automatically incremented by the database.boolean
isGenerated()
Determine whether this column's values are generated by the database.boolean
isOptional()
Determine whether this column is optional.default boolean
isRequired()
Determine whether this column is required.int
jdbcType()
Get theJDBC type
for this columnint
length()
Get the maximum length of this column's values.String
name()
Get the name of the column.int
nativeType()
Get the database native type for this columnint
position()
Get the position of the column in the table.Optional<Integer>
scale()
Get the scale of the column.String
typeExpression()
Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.String
typeName()
Get the database-specific name of the column's data type.default boolean
typeUsesCharset()
Determine whether this column has atypeName()
orjdbcType()
to which a character set applies.
-
-
-
Field Detail
-
UNSET_INT_VALUE
static final int UNSET_INT_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
editor
static ColumnEditor editor()
Obtain an column definition editor that can be used to define a column.- Returns:
- the editor; never null
-
name
String name()
Get the name of the column.- Returns:
- the column name; never null
-
position
int position()
Get the position of the column in the table.- Returns:
- the 1-based position
-
jdbcType
int jdbcType()
Get theJDBC type
for this column- Returns:
- the type constant
-
nativeType
int nativeType()
Get the database native type for this column- Returns:
- a type constant for the specific database
-
typeName
String typeName()
Get the database-specific name of the column's data type.- Returns:
- the name of the type
-
typeExpression
String typeExpression()
Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.- Returns:
- the complete type expression
-
charsetName
String charsetName()
Get the database-specific name of the character set used by this column.- Returns:
- the database-specific character set name, or null if the column's data type doesn't
use character sets
or no character set is specified
-
length
int length()
Get the maximum length of this column's values. For numeric columns, this represents the precision.- Returns:
- the length of the column
-
scale
Optional<Integer> scale()
Get the scale of the column.- Returns:
- the scale if it applies to this type
-
isOptional
boolean isOptional()
Determine whether this column is optional.- Returns:
true
if it is optional, orfalse
otherwise- See Also:
isRequired()
-
isRequired
default boolean isRequired()
Determine whether this column is required. This is equivalent to calling!isOptional()
.- Returns:
true
if it is required (not optional), orfalse
otherwise- See Also:
isOptional()
-
isAutoIncremented
boolean isAutoIncremented()
Determine whether this column's values are automatically incremented by the database.- Returns:
true
if the values are auto-incremented, orfalse
otherwise
-
isGenerated
boolean isGenerated()
Determine whether this column's values are generated by the database.- Returns:
true
if the values are generated, orfalse
otherwise
-
defaultValue
Object defaultValue()
Get the default value of the column- Returns:
- the default value
-
hasDefaultValue
boolean hasDefaultValue()
Determine whether this column's has a default value- Returns:
true
if the default value was provided, orfalse
otherwise
-
enumValues
List<String> enumValues()
Get the list of values associated with the enum- Returns:
- the list of enum values
-
compareTo
default int compareTo(Column that)
- Specified by:
compareTo
in interfaceComparable<Column>
-
edit
ColumnEditor edit()
Obtain an editor that contains the same information as this column definition.- Returns:
- the editor; never null
-
typeUsesCharset
default boolean typeUsesCharset()
Determine whether this column has atypeName()
orjdbcType()
to which a character set applies.- Returns:
true
if a character set applies the column's type, orfalse
otherwise
-
-