java.lang.Object
java.lang.Record
org.litebridgedb.orm.api.spec.FieldSpec
- Record Components:
dtoClass- The class of the DTO to which the field belongs.name- The name of the field or property to be mapped.property- Indicates whether property-level access is enabled.truesignifies property-based access (via getter/setter), andfalsesignifies direct field access.
- All Implemented Interfaces:
FieldMapping
public record FieldSpec(@Nullable Class<?> dtoClass, String name, boolean property)
extends Record
implements FieldMapping
Represents a specification for mapping a field in a class to a database column or property.
This class is part of the ORM specification for defining how fields or properties in a DTO (Data Transfer Object) are mapped to their corresponding database representations.
A FieldSpec can represent a field-level or property-level access based on the
property flag. Field-level access considers the field name directly for mapping,
whereas property-level access assumes usage of getter/setter conventions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Class<?> dtoClass()Returns the value of thedtoClassrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanproperty()Returns the value of thepropertyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
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 '=='. -
dtoClass
Returns the value of thedtoClassrecord component.- Returns:
- the value of the
dtoClassrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
property
public boolean property()Returns the value of thepropertyrecord component.- Returns:
- the value of the
propertyrecord component
-