Class ItemDeltaSingleValueProcessor<T>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqale.delta.ItemDeltaValueProcessor<T>
-
- com.evolveum.midpoint.repo.sqale.delta.item.ItemDeltaSingleValueProcessor<T>
-
- Type Parameters:
T
- expected type of the real value for the modification (after optional conversion)
- All Implemented Interfaces:
ItemDeltaProcessor
- Direct Known Subclasses:
EmbeddedContainerDeltaProcessor
,ExtensionContainerDeltaProcessor
,PolyStringItemDeltaProcessor
,RefItemDeltaProcessor
,SinglePathItemDeltaProcessor
public abstract class ItemDeltaSingleValueProcessor<T> extends ItemDeltaValueProcessor<T>
Applies single item delta value to an item. This class implementssetRealValues(java.util.Collection<?>)
(for multiple values) and requiressetValue(T)
(for a single value) to be implemented by the subclasses. This hierarchy branch should not needItemDeltaValueProcessor.addRealValues(java.util.Collection<?>)
andItemDeltaValueProcessor.deleteRealValues(java.util.Collection<?>)
, so it's not overridden and throwsUnsupportedOperationException
.
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.repo.sqale.delta.ItemDeltaValueProcessor
context
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ItemDeltaSingleValueProcessor(SqaleUpdateContext<?,?,?> context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected T
getAnyValue(ItemDelta<?,?> modification)
Often the single real value is necessary, optionally converted usingItemDeltaValueProcessor.convertRealValue(Object)
to get expected type.void
process(ItemDelta<?,?> modification)
Default process implementation, most generic case covering especially multi-values stored in separate rows.void
setRealValues(Collection<?> values)
Sets the provided real values in the database, implements REPLACE modification.abstract void
setValue(T value)
Sets the database columns to reflect the provided value (converted if necessary).-
Methods inherited from class com.evolveum.midpoint.repo.sqale.delta.ItemDeltaValueProcessor
addRealValues, addValues, convertRealValue, delete, deleteRealValues, deleteValues
-
-
-
-
Constructor Detail
-
ItemDeltaSingleValueProcessor
protected ItemDeltaSingleValueProcessor(SqaleUpdateContext<?,?,?> context)
-
-
Method Detail
-
process
public void process(ItemDelta<?,?> modification) throws RepositoryException, SchemaException
Description copied from class:ItemDeltaValueProcessor
Default process implementation, most generic case covering especially multi-values stored in separate rows. This works when implementations ofItemDeltaValueProcessor.deleteRealValues(java.util.Collection<?>)
andItemDeltaValueProcessor.addRealValues(java.util.Collection<?>)
are independent, it's not usable for array update where a single `SET` clause is allowed.- Specified by:
process
in interfaceItemDeltaProcessor
- Overrides:
process
in classItemDeltaValueProcessor<T>
- Throws:
RepositoryException
SchemaException
-
getAnyValue
protected T getAnyValue(ItemDelta<?,?> modification)
Often the single real value is necessary, optionally converted usingItemDeltaValueProcessor.convertRealValue(Object)
to get expected type. Either method can be overridden or not used at all depending on the complexity of the concrete delta processor.
-
setValue
public abstract void setValue(T value) throws SchemaException
Sets the database columns to reflect the provided value (converted if necessary).- Throws:
SchemaException
-
setRealValues
public void setRealValues(Collection<?> values) throws SchemaException
Description copied from class:ItemDeltaValueProcessor
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.- Overrides:
setRealValues
in classItemDeltaValueProcessor<T>
- Throws:
SchemaException
-
-