Record Class Column

java.lang.Object
java.lang.Record
io.bloviate.db.Column
Record Components:
name - the column name
tableName - the name of the table containing this column
schema - the schema name, may be null for databases that don't use schemas
catalog - the catalog name, may be null for databases that don't use catalogs
jdbcType - the standard JDBC data type for this column
maxSize - the maximum size/length for this column, null if not applicable
maxDigits - the maximum number of digits for numeric columns, null if not applicable
typeName - the database-specific type name (e.g., "VARCHAR", "INTEGER")
autoIncrement - true if this column is auto-increment/identity, null if unknown
nullable - true if this column accepts NULL values, null if unknown
defaultValue - the default value expression, null if none specified
ordinalPosition - the 1-based position of this column within the table

public record Column(String name, String tableName, String schema, String catalog, JDBCType jdbcType, Integer maxSize, Integer maxDigits, String typeName, Boolean autoIncrement, Boolean nullable, String defaultValue, Integer ordinalPosition) extends Record
Represents a database column with its complete metadata.

This immutable record encapsulates all metadata for a database column as discovered through JDBC metadata analysis. The information includes data type, constraints, size limits, and positioning within the table structure.

Column metadata is used by DatabaseSupport implementations to select appropriate DataGenerator instances for generating realistic test data that respects the column's constraints.

Author:
Tim Veil
See Also:
  • Constructor Details

    • Column

      public Column(String name, String tableName, String schema, String catalog, JDBCType jdbcType, Integer maxSize, Integer maxDigits, String typeName, Boolean autoIncrement, Boolean nullable, String defaultValue, Integer ordinalPosition)
      Creates an instance of a Column record class.
      Parameters:
      name - the value for the name record component
      tableName - the value for the tableName record component
      schema - the value for the schema record component
      catalog - the value for the catalog record component
      jdbcType - the value for the jdbcType record component
      maxSize - the value for the maxSize record component
      maxDigits - the value for the maxDigits record component
      typeName - the value for the typeName record component
      autoIncrement - the value for the autoIncrement record component
      nullable - the value for the nullable record component
      defaultValue - the value for the defaultValue record component
      ordinalPosition - the value for the ordinalPosition record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • tableName

      public String tableName()
      Returns the value of the tableName record component.
      Returns:
      the value of the tableName record component
    • schema

      public String schema()
      Returns the value of the schema record component.
      Returns:
      the value of the schema record component
    • catalog

      public String catalog()
      Returns the value of the catalog record component.
      Returns:
      the value of the catalog record component
    • jdbcType

      public JDBCType jdbcType()
      Returns the value of the jdbcType record component.
      Returns:
      the value of the jdbcType record component
    • maxSize

      public Integer maxSize()
      Returns the value of the maxSize record component.
      Returns:
      the value of the maxSize record component
    • maxDigits

      public Integer maxDigits()
      Returns the value of the maxDigits record component.
      Returns:
      the value of the maxDigits record component
    • typeName

      public String typeName()
      Returns the value of the typeName record component.
      Returns:
      the value of the typeName record component
    • autoIncrement

      public Boolean autoIncrement()
      Returns the value of the autoIncrement record component.
      Returns:
      the value of the autoIncrement record component
    • nullable

      public Boolean nullable()
      Returns the value of the nullable record component.
      Returns:
      the value of the nullable record component
    • defaultValue

      public String defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component
    • ordinalPosition

      public Integer ordinalPosition()
      Returns the value of the ordinalPosition record component.
      Returns:
      the value of the ordinalPosition record component