java.lang.Object
java.lang.Record
org.litebridgedb.orm.api.spec.FieldColumnSpec
- Record Components:
field- TheFieldSpecrepresenting the DTO field or property being mapped.column- TheColumnMappingrepresenting the database mapping for the field.
Represents the mapping between a specific field in a Data Transfer Object (DTO) and its
corresponding database column specification.
This record combines a FieldSpec that defines the characteristics of the field
or property being mapped with a ColumnMapping that defines how the field maps
to the database representation. It is a core component of the ORM framework for defining
field-to-column mappings in a concise, type-safe manner.
The FieldColumnSpec record provides a utility method to retrieve the column
specification as a ColumnSpec, which is useful for direct column mappings.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldColumnSpec(FieldSpec field, ColumnMapping column) Creates an instance of aFieldColumnSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the value of thecolumnrecord component.Retrieves the database column specification as aColumnSpec.final booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
columnSpec
Retrieves the database column specification as aColumnSpec.This method provides a type-safe way to access the column mapping for the associated field in the form of a
ColumnSpec, which represents the configuration and metadata of the target database column.- Returns:
- The
ColumnSpecrepresenting the column mapping for the field in the DTO. - Throws:
IllegalArgumentException- if the provided column mapping is not an instance ofColumnSpec.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
field
Returns the value of thefieldrecord component.- Returns:
- the value of the
fieldrecord component
-
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-