Class ItemDeltaValueProcessor<T>

java.lang.Object
com.evolveum.midpoint.repo.sqale.delta.ItemDeltaValueProcessor<T>
Type Parameters:
T - expected type of the real value for the modification (after optional conversion)
All Implemented Interfaces:
ItemDeltaProcessor
Direct Known Subclasses:
ContainerTableDeltaProcessor, FinalValueDeltaProcessor, ItemDeltaSingleValueProcessor, RefTableItemDeltaProcessor

public abstract class ItemDeltaValueProcessor<T> extends Object implements ItemDeltaProcessor
Applies item delta values to an item and arranges necessary SQL changes using update context. This typically means adding set clauses to the update but can also mean adding rows for containers, etc. This kind of item delta processor does not resolve multi-part item paths, see other subclasses of ItemDeltaProcessor for that. The class also declares more specific methods for applying values (add, replace, delete), because in some scenarios we work with items and not with item delta modifications anymore. Implementations populate updates contained in the context using SqaleUpdateContext.set(P, T) method (these will be executed later) or issue insert/delete statements which are executed immediately which is responsibility of the processor.
  • Field Details

  • Constructor Details

    • ItemDeltaValueProcessor

      protected ItemDeltaValueProcessor(SqaleUpdateContext<?,?,?> context)
  • Method Details

    • process

      public void process(ItemDelta<?,?> modification) throws RepositoryException, SchemaException
      Default process implementation, most generic case covering especially multi-values stored in separate rows. This works when implementations of deleteRealValues(java.util.Collection<?>) and addRealValues(java.util.Collection<?>) are independent, it's not usable for array update where a single `SET` clause is allowed.
      Specified by:
      process in interface ItemDeltaProcessor
      Throws:
      RepositoryException
      SchemaException
    • useRealDeltaApplyResults

      protected boolean useRealDeltaApplyResults()
    • modifyRealValue

      protected void modifyRealValue(T realValue) throws SchemaException
      Throws:
      SchemaException
    • deleteRealValue

      protected void deleteRealValue(T realValue)
    • addRealValue

      protected void addRealValue(T realValue) throws SchemaException
      Throws:
      SchemaException
    • convertRealValue

      @Nullable public T convertRealValue(Object realValue)
      Default conversion for one value is a mere type cast, override as necessary.
    • setRealValues

      public void setRealValues(Collection<?> values) throws SchemaException
      Sets the provided real values in the database, implements REPLACE modification. This may involve setting the value of some columns or delete/insert of sub-entities. This is a general case covering both multi-value and single-value items.
      Throws:
      SchemaException
    • addRealValues

      public void addRealValues(Collection<?> values) throws SchemaException
      Adds the provided real values to the database, implements ADD modification.
      Throws:
      SchemaException
    • addValues

      public void addValues(Collection<T> values) throws SchemaException
      Throws:
      SchemaException
    • deleteRealValues

      public void deleteRealValues(Collection<?> values)
      Adds the provided real values to the database, implements ADD modification.
    • deleteValues

      public void deleteValues(Collection<T> values)
    • delete

      public abstract void delete()
      Resets the database columns or deletes sub-entities like refs, containers, etc. This must be implemented to support clearing the columns of single-value embedded containers.