java.lang.Object
org.litebridgedb.db.spi.ColumnMetaData
- All Implemented Interfaces:
MappedFieldTarget
Metadata information for a database column.
This class extends the functionality of the Column class to include additional attributes
typically associated with database column metadata, such as nullability, data type, size, and others.
Instances of this class are immutable except for specific mutable fields like auto-increment, sequence, and joinColumn, which can be modified after initialization.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnMetaData(Table table, String name, boolean nullable, int dataType) Construct an instance ofColumnMetaDatawith specified metadata details about a database column.ColumnMetaData(Table table, String name, boolean nullable, int dataType, int size) Construct an instance ofColumnMetaDatawith specified metadata details about a database column.ColumnMetaData(Table table, String name, boolean nullable, int dataType, int size, int decimalDigits, boolean autoIncrement, @Nullable String sequence) Construct an instance ofColumnMetaDatawith specified metadata details about a database column. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintRetrieve the data type of the column, as specified inTypes.intRetrieve the number of decimal digits for the column.@Nullable String@Nullable StringintgetSize()Retrieve the size of the column.inthashCode()booleanCheck if the column's value is automatically incremented by the database.booleanDetermine if the column allows null values.name()voidsetAutoIncrement(boolean autoIncrement) voidsetJoinColumn(@Nullable String joinColumn) voidsetSequence(@Nullable String sequence) table()toColumn()toString()
-
Constructor Details
-
ColumnMetaData
public ColumnMetaData(Table table, String name, boolean nullable, int dataType, int size, int decimalDigits, boolean autoIncrement, @Nullable String sequence) Construct an instance ofColumnMetaDatawith specified metadata details about a database column.- Parameters:
table- the table to which this column belongs; must not be nullname- the name of the column; must not be nullnullable- a flag indicating whether the column allows null valuesdataType- the SQL data type of the column as defined inTypessize- the size of the column, typically representing the maximum number of characters for string or digits for numeric typesdecimalDigits- the number of decimal digits for the column, applicable for numeric typesautoIncrement- a flag indicating whether the column is defined as auto-incrementsequence- the name of the sequence associated with the column, or null if no sequence is associated
-
ColumnMetaData
Construct an instance ofColumnMetaDatawith specified metadata details about a database column.Sets
decimalDigitsto0,autoIncrementtofalse, andsequencetonull.- Parameters:
table- the table to which this column belongs; must not be nullname- the name of the column; must not be nullnullable- a flag indicating whether the column allows null valuesdataType- the SQL data type of the column as defined inTypessize- the size of the column, typically representing the maximum number of characters for string or digits for numeric types
-
ColumnMetaData
Construct an instance ofColumnMetaDatawith specified metadata details about a database column.Sets
decimalDigitsandsizeto0,autoIncrementtofalse, andsequencetonull.- Parameters:
table- the table to which this column belongs; must not be nullname- the name of the column; must not be nullnullable- a flag indicating whether the column allows null valuesdataType- the SQL data type of the column as defined inTypes
-
-
Method Details
-
name
-
table
-
isNullable
public boolean isNullable()Determine if the column allows null values.- Returns:
trueif the column allows null values, otherwisefalse.
-
getDataType
public int getDataType()Retrieve the data type of the column, as specified inTypes.- Returns:
- the SQL data type.
- See Also:
-
getSize
public int getSize()Retrieve the size of the column.- Returns:
- the size of the column.
-
getDecimalDigits
public int getDecimalDigits()Retrieve the number of decimal digits for the column.- Returns:
- the number of decimal digits specified for the column.
-
isAutoIncrement
public boolean isAutoIncrement()Check if the column's value is automatically incremented by the database.- Returns:
trueif the column is marked as auto-increment,falseotherwise.
-
setAutoIncrement
public void setAutoIncrement(boolean autoIncrement) -
getSequence
-
setSequence
-
getJoinColumn
-
setJoinColumn
-
toColumn
-
equals
-
hashCode
public int hashCode() -
toString
-