Class EmbeddedPropertyType<ENTITY,EMBEDDABLE>
- Type Parameters:
ENTITY- the entity type containing this embeddable propertyEMBEDDABLE- the embeddable type
An embeddable property is a property whose type is annotated with Embeddable and contains multiple properties that are mapped to database columns.
This class manages the relationship between the entity property and its constituent embeddable
properties.
Implementations of this class are typically generated at compile time by the Doma annotation processor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,EntityPropertyType<ENTITY, ?>> protected final List<EntityPropertyType<ENTITY,?>> protected final PropertyField<ENTITY>protected final booleanprotected final PropertyPath -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedPropertyType(String name, Class<ENTITY> entityClass, List<EntityPropertyType<ENTITY, ?>> embeddablePropertyType, boolean optional) EmbeddedPropertyType(PropertyPath path, Class<ENTITY> entityClass, List<EntityPropertyType<ENTITY, ?>> embeddablePropertyType, boolean optional) -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of entity property types that are part of this embeddable property.Returns the list of entity property types that are part of this embeddable property.voidsave(ENTITY entity, EMBEDDABLE value) Sets the embeddable value in the entity.
-
Field Details
-
path
-
embeddablePropertyTypes
-
embeddablePropertyTypeMap
-
optional
protected final boolean optional -
field
-
-
Constructor Details
-
EmbeddedPropertyType
-
EmbeddedPropertyType
public EmbeddedPropertyType(PropertyPath path, Class<ENTITY> entityClass, List<EntityPropertyType<ENTITY, ?>> embeddablePropertyType, boolean optional)
-
-
Method Details
-
getEmbeddablePropertyTypes
Returns the list of entity property types that are part of this embeddable property.These property types represent the individual properties within the embeddable object that are mapped to database columns.
- Returns:
- the list of entity property types in this embeddable property
-
getEmbeddablePropertyTypeMap
Returns a map of entity property types that are part of this embeddable property.The map keys are the property names, and the values are the corresponding entity property types. This provides a convenient way to look up properties by name within the embeddable object.
- Returns:
- a map of property names to entity property types in this embeddable property
-
save
Sets the embeddable value in the entity.This method is used to update the embeddable property in the entity with a new value, typically during entity construction or when loading data from the database.
- Parameters:
entity- the entity in which to set the embeddable valuevalue- the embeddable value to set
-