java.lang.Object
java.lang.Record
org.litebridge.orm.persistence.MappedCompositeKey
- Record Components:
columns- Database columns that make up the composite key.
- All Implemented Interfaces:
MappedFieldTarget
public record MappedCompositeKey(MappedFieldTarget[] columns, Supplier<OrmTable> targetOrmTable, String[] targetColumns)
extends Record
implements MappedFieldTarget
A mapped composite key, used for mapping multiple columns to a single field containing a related DTO.
-
Constructor Summary
ConstructorsConstructorDescriptionMappedCompositeKey(MappedFieldTarget[] columns, Supplier<OrmTable> targetOrmTable, String[] targetColumns) Creates an instance of aMappedCompositeKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumns()Returns the value of thecolumnsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.String[]Returns the value of thetargetColumnsrecord component.Returns the value of thetargetOrmTablerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MappedCompositeKey
public MappedCompositeKey(MappedFieldTarget[] columns, Supplier<OrmTable> targetOrmTable, String[] targetColumns) Creates an instance of aMappedCompositeKeyrecord class.- Parameters:
columns- the value for thecolumnsrecord componenttargetOrmTable- the value for thetargetOrmTablerecord componenttargetColumns- the value for thetargetColumnsrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
targetOrmTable
Returns the value of thetargetOrmTablerecord component.- Returns:
- the value of the
targetOrmTablerecord component
-
targetColumns
Returns the value of thetargetColumnsrecord component.- Returns:
- the value of the
targetColumnsrecord component
-