Package guru.mikelue.foxglove
Record Class ColumnMeta
java.lang.Object
java.lang.Record
guru.mikelue.foxglove.ColumnMeta
- Record Components:
name- The name of the columnproperties- The true/false properties of this columntypeName- The name of type for the columnjdbcType- The correspondingJDBCTypeof the columnsize- The size of the columndecimalDigits- The number of decimal digits of the column(as scale of SQL standard)
public record ColumnMeta(String name, EnumSet<ColumnMeta.Property> properties, String typeName, JDBCType jdbcType, int size, int decimalDigits)
extends Record
Metadata of a column.
From
The columns mapping to this object are:
The information could come from:
From DatabaseMetaData.getColumns(String, String, String, String)
The columns mapping to this object are:
COLUMN_NAME- forname()TYPE_NAME- fortypeName()DATA_TYPE- forjdbcType()NULLABLE- forColumnMeta.Property.NULLABLECOLUMN_DEF- forColumnMeta.Property.DEFAULT_VALUEIS_AUTOINCREMENT- forColumnMeta.Property.AUTO_INCREMENTIS_GENERATEDCOLUMN- forColumnMeta.Property.GENERATEDCOLUMN_SIZE- forsize()DECIMAL_DIGITS- fordecimalDigits()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe properties used for auto-generating of a column. -
Constructor Summary
ConstructorsConstructorDescriptionColumnMeta(String name, EnumSet<ColumnMeta.Property> properties, String typeName, JDBCType jdbcType, int size, int decimalDigits) Creates an instance of aColumnMetarecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedecimalDigitsrecord component.booleanOnly use name andJDBCTypeof column for equality check.inthashCode()Only use name of column for hash code.jdbcType()Returns the value of thejdbcTyperecord component.name()Returns the value of thenamerecord component.Returns the value of thepropertiesrecord component.intsize()Returns the value of thesizerecord component.toString()Builds complete properties and descriptive information of column metadata.typeName()Returns the value of thetypeNamerecord component.
-
Constructor Details
-
ColumnMeta
public ColumnMeta(String name, EnumSet<ColumnMeta.Property> properties, String typeName, JDBCType jdbcType, int size, int decimalDigits) Creates an instance of aColumnMetarecord class.- Parameters:
name- the value for thenamerecord componentproperties- the value for thepropertiesrecord componenttypeName- the value for thetypeNamerecord componentjdbcType- the value for thejdbcTyperecord componentsize- the value for thesizerecord componentdecimalDigits- the value for thedecimalDigitsrecord component
-
-
Method Details
-
hashCode
public int hashCode()Only use name of column for hash code. -
equals
Only use name andJDBCTypeof column for equality check.- Specified by:
equalsin classRecord- Parameters:
obj- The other object to be checked- Returns:
- True if the other object is a
ColumnMetaand has same name
-
toString
Builds complete properties and descriptive information of column metadata. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-
typeName
Returns the value of thetypeNamerecord component.- Returns:
- the value of the
typeNamerecord component
-
jdbcType
Returns the value of thejdbcTyperecord component.- Returns:
- the value of the
jdbcTyperecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
decimalDigits
public int decimalDigits()Returns the value of thedecimalDigitsrecord component.- Returns:
- the value of the
decimalDigitsrecord component
-