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 intUNSET_INT_VALUE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringcharsetName()Get the database-specific name of the character set used by this column.default intcompareTo(Column that)ObjectdefaultValue()Get the default value of the columnColumnEditoredit()Obtain an editor that contains the same information as this column definition.static ColumnEditoreditor()Obtain an column definition editor that can be used to define a column.List<String>enumValues()Get the list of values associated with the enumbooleanhasDefaultValue()Determine whether this column's has a default valuebooleanisAutoIncremented()Determine whether this column's values are automatically incremented by the database.booleanisGenerated()Determine whether this column's values are generated by the database.booleanisOptional()Determine whether this column is optional.default booleanisRequired()Determine whether this column is required.intjdbcType()Get theJDBC typefor this columnintlength()Get the maximum length of this column's values.Stringname()Get the name of the column.intnativeType()Get the database native type for this columnintposition()Get the position of the column in the table.Optional<Integer>scale()Get the scale of the column.StringtypeExpression()Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.StringtypeName()Get the database-specific name of the column's data type.default booleantypeUsesCharset()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 typefor 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 setsor 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:
trueif it is optional, orfalseotherwise- See Also:
isRequired()
-
isRequired
default boolean isRequired()
Determine whether this column is required. This is equivalent to calling!isOptional().- Returns:
trueif it is required (not optional), orfalseotherwise- See Also:
isOptional()
-
isAutoIncremented
boolean isAutoIncremented()
Determine whether this column's values are automatically incremented by the database.- Returns:
trueif the values are auto-incremented, orfalseotherwise
-
isGenerated
boolean isGenerated()
Determine whether this column's values are generated by the database.- Returns:
trueif the values are generated, orfalseotherwise
-
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:
trueif the default value was provided, orfalseotherwise
-
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:
compareToin 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:
trueif a character set applies the column's type, orfalseotherwise
-
-