Class EmbeddedPropertyHandler
java.lang.Object
cloud.quinimbus.persistence.api.entity.EmbeddedPropertyHandler
This class is the base class to implement embeddable property handlers. Property handlers can be used to implement
custom handling of embeddable properties. If you use records for the domain model you have to register such a
handler using the
Embeddable.handler()
field at the embeddable record.
For the json variant you have to add the field handlerClass
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedPropertyHandler
(PersistenceContext context, String schemaId, String typeId, String property) -
Method Summary
Modifier and TypeMethodDescription<T extends PropertyContext>
Optional<T> getPropertyContext
(String name, Class<T> type) abstract void
init()
<T extends LifecycleEvent>
voidonLifecycleEvent
(Class<T> eventType, Consumer<T> consumer)
-
Constructor Details
-
EmbeddedPropertyHandler
public EmbeddedPropertyHandler(PersistenceContext context, String schemaId, String typeId, String property)
-
-
Method Details
-
onLifecycleEvent
-
newEmbedded
public EmbeddedObject newEmbedded(Map<String, Object> properties, Map<String, throws UnparseableValueExceptionObject> transientFields) - Throws:
UnparseableValueException
-
getSchema
- Returns:
- The schema associated to the entity this handler is registered to
-
getParentType
- Returns:
- The parent entity type of the entity this embeddable is embedded into
-
getPropertyType
- Returns:
- The embedded property type of the entity this embeddable is embedded into
-
getEntityTypeProperty
- Returns:
- The property of the entity this embeddable is embedded into
-
getPropertyContext
- Type Parameters:
T
- The type of the property context- Parameters:
name
- The name of the requested contexttype
- The type of the requested context- Returns:
- The requested property context or an empty
Optional
if no context is available for the given name
-
init
public abstract void init()
-