Record Class FieldMapping<C,T>
java.lang.Object
java.lang.Record
jakarta.persistence.sql.FieldMapping<C,T>
- Type Parameters:
C- The type of the entity or embeddable typeT- The type of the field- Record Components:
container- The Java class which declares the fieldtype- The Java class of the fieldname- The name of the fieldcolumnName- The name of the mapped column of the result set
- All Implemented Interfaces:
MemberMapping<C>
public record FieldMapping<C,T> (@Nonnull Class<? super C> container, @Nonnull Class<T> type, @Nonnull String name, @Nonnull String columnName)
extends Record
implements MemberMapping<C>
Maps a column of a JDBC
ResultSet to a given
field or column of an entity or embeddable type.- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolumnNamerecord component.Returns the value of thecontainerrecord 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.static <C,T> FieldMapping <C, T> of(SingularAttribute<? super C, T> attribute, String columnName) Construct a new instance.static <C,T> FieldMapping <C, T> Construct a new instance.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
FieldMapping
public FieldMapping(@Nonnull Class<? super C> container, @Nonnull Class<T> type, @Nonnull String name, @Nonnull String columnName) Creates an instance of aFieldMappingrecord class.- Parameters:
container- the value for thecontainerrecord componenttype- the value for thetyperecord componentname- the value for thenamerecord componentcolumnName- the value for thecolumnNamerecord component
-
-
Method Details
-
of
@Nonnull public static <C,T> FieldMapping<C,T> of(@Nonnull Class<? super C> container, @Nonnull Class<T> type, @Nonnull String name, @Nonnull String columnName) Construct a new instance.- Type Parameters:
C- The type of the entity or embeddable typeT- The type of the field- Parameters:
container- The Java class which declares the fieldtype- The Java class of the fieldname- The name of the fieldcolumnName- The name of the mapped column of the result set
-
of
@Nonnull public static <C,T> FieldMapping<C,T> of(@Nonnull SingularAttribute<? super C, T> attribute, @Nonnull String columnName) Construct a new instance.- Type Parameters:
C- The type of the entity or embeddable typeT- The type of the field- Parameters:
attribute- The metamodel object representing the fieldcolumnName- The name of the mapped column of the result set
-
toString
-
hashCode
-
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). -
container
-
type
-
name
-
columnName
Returns the value of thecolumnNamerecord component.- Returns:
- the value of the
columnNamerecord component
-