Class EmbeddedPropertyHandler

java.lang.Object
cloud.quinimbus.persistence.api.entity.EmbeddedPropertyHandler

public abstract class EmbeddedPropertyHandler extends Object
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 Details

  • Method Details

    • onLifecycleEvent

      public <T extends LifecycleEvent> void onLifecycleEvent(Class<T> eventType, Consumer<T> consumer)
    • newEmbedded

      public EmbeddedObject newEmbedded(Map<String,Object> properties, Map<String,Object> transientFields) throws UnparseableValueException
      Throws:
      UnparseableValueException
    • getSchema

      public Schema getSchema()
      Returns:
      The schema associated to the entity this handler is registered to
    • getParentType

      public EntityType getParentType()
      Returns:
      The parent entity type of the entity this embeddable is embedded into
    • getPropertyType

      public EmbeddedPropertyType getPropertyType()
      Returns:
      The embedded property type of the entity this embeddable is embedded into
    • getEntityTypeProperty

      public EntityTypeProperty getEntityTypeProperty()
      Returns:
      The property of the entity this embeddable is embedded into
    • getPropertyContext

      public <T extends PropertyContext> Optional<T> getPropertyContext(String name, Class<T> type)
      Type Parameters:
      T - The type of the property context
      Parameters:
      name - The name of the requested context
      type - 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()