Record Class ColumnSpec

java.lang.Object
java.lang.Record
org.litebridgedb.orm.api.spec.ColumnSpec
Record Components:
name - Database column name
isAutoIncrement - Whether column is set to auto-increment
sequence - Name of the sequence used to generate values for this column
joinColumn - Field name of the nested DTO to join on
mappedTable - In-line mapped table specification
All Implemented Interfaces:
ColumnMapping

@NullMarked public record ColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn, @Nullable TableMapping mappedTable) extends Record implements ColumnMapping
Specification of a database column, used to map DTO fields to target columns.

This class is immutable and provides various factory methods to create instances with different configurations.

  • Constructor Details

    • ColumnSpec

      public ColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn)
    • ColumnSpec

      public ColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn, @Nullable TableMapping mappedTable)
      Creates an instance of a ColumnSpec record class.
      Parameters:
      name - the value for the name record component
      isAutoIncrement - the value for the isAutoIncrement record component
      sequence - the value for the sequence record component
      joinColumn - the value for the joinColumn record component
      mappedTable - the value for the mappedTable 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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
    • isAutoIncrement

      public boolean isAutoIncrement()
      Returns the value of the isAutoIncrement record component.
      Returns:
      the value of the isAutoIncrement record component
    • sequence

      public @Nullable String sequence()
      Returns the value of the sequence record component.
      Returns:
      the value of the sequence record component
    • joinColumn

      public @Nullable String joinColumn()
      Returns the value of the joinColumn record component.
      Returns:
      the value of the joinColumn record component
    • mappedTable

      public @Nullable TableMapping mappedTable()
      Returns the value of the mappedTable record component.
      Returns:
      the value of the mappedTable record component