Record Class EmbeddedMapping<C,T>
java.lang.Object
java.lang.Record
jakarta.persistence.sql.EmbeddedMapping<C,T>
- Type Parameters:
C- The container typeT- The embeddable type- Record Components:
container- The Java class which declares the field holding the embedded objectembeddableClass- The embeddable classname- The name of the field holding the embedded objectfields- Mappings for fields or properties of the entity
- All Implemented Interfaces:
MemberMapping<C>
public record EmbeddedMapping<C,T> (@Nonnull Class<? super C> container, @Nonnull Class<T> embeddableClass, @Nonnull String name, @Nonnull MemberMapping<T>[] fields)
extends Record
implements MemberMapping<C>
Maps columns of a JDBC
ResultSet to a given
embedded object.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedMapping(Class<? super C> container, Class<T> embeddableClass, String name, MemberMapping<T>[] fields) Creates an instance of aEmbeddedMappingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontainerrecord component.Returns the value of theembeddableClassrecord component.final booleanIndicates whether some other object is "equal to" this one.MemberMapping<T>[]fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static <C,T> EmbeddedMapping <C, T> of(SingularAttribute<? super C, T> embedded, MemberMapping<T>... fields) Construct a new instance.static <C,T> EmbeddedMapping <C, T> of(Class<? super C> container, Class<T> embeddableClass, String name, MemberMapping<T>... fields) Construct a new instance.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EmbeddedMapping
public EmbeddedMapping(@Nonnull Class<? super C> container, @Nonnull Class<T> embeddableClass, @Nonnull String name, @Nonnull MemberMapping<T>[] fields) Creates an instance of aEmbeddedMappingrecord class.- Parameters:
container- the value for thecontainerrecord componentembeddableClass- the value for theembeddableClassrecord componentname- the value for thenamerecord componentfields- the value for thefieldsrecord component
-
-
Method Details
-
fields
-
of
@SafeVarargs @Nonnull public static <C,T> EmbeddedMapping<C,T> of(@Nonnull Class<? super C> container, @Nonnull Class<T> embeddableClass, @Nonnull String name, @Nonnull MemberMapping<T>... fields) Construct a new instance.- Type Parameters:
C- The container typeT- The embeddable type- Parameters:
container- The Java class which declares the field holding the embedded objectembeddableClass- The embeddable classname- The name of the field holding the embedded objectfields- Mappings for fields or properties of the entity
-
of
@SafeVarargs public static <C,T> EmbeddedMapping<C,T> of(@Nonnull SingularAttribute<? super C, T> embedded, @Nonnull MemberMapping<T>... fields) Construct a new instance.- Type Parameters:
C- The container typeT- The embeddable type- Parameters:
embedded- The metamodel object representing the embedded objectfields- Mappings for fields or properties of the entity
-
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
-
embeddableClass
Returns the value of theembeddableClassrecord component.- Returns:
- the value of the
embeddableClassrecord component
-
name
-