java.lang.Object
java.lang.Record
org.litebridgedb.orm.api.spec.ColumnSpec
- Record Components:
name- Database column nameisAutoIncrement- Whether column is set to auto-incrementsequence- Name of the sequence used to generate values for this columnjoinColumn- Field name of the nested DTO to join onmappedTable- 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 Summary
ConstructorsConstructorDescriptionColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn) ColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn, @Nullable TableMapping mappedTable) Creates an instance of aColumnSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisAutoIncrementrecord component.@Nullable StringReturns the value of thejoinColumnrecord component.@Nullable TableMappingReturns the value of themappedTablerecord component.name()Returns the value of thenamerecord component.@Nullable Stringsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ColumnSpec
-
ColumnSpec
public ColumnSpec(String name, boolean isAutoIncrement, @Nullable String sequence, @Nullable String joinColumn, @Nullable TableMapping mappedTable) Creates an instance of aColumnSpecrecord class.- Parameters:
name- the value for thenamerecord componentisAutoIncrement- the value for theisAutoIncrementrecord componentsequence- the value for thesequencerecord componentjoinColumn- the value for thejoinColumnrecord componentmappedTable- the value for themappedTablerecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
isAutoIncrement
public boolean isAutoIncrement()Returns the value of theisAutoIncrementrecord component.- Returns:
- the value of the
isAutoIncrementrecord component
-
sequence
Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-
joinColumn
Returns the value of thejoinColumnrecord component.- Returns:
- the value of the
joinColumnrecord component
-
mappedTable
Returns the value of themappedTablerecord component.- Returns:
- the value of the
mappedTablerecord component
-