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 ofItemDeltaProcessor
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 thecontext
usingSqaleUpdateContext.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 Summary
Fields Modifier and Type Field Description protected SqaleUpdateContext<?,?,?>
context
-
Constructor Summary
Constructors Modifier Constructor Description protected
ItemDeltaValueProcessor(SqaleUpdateContext<?,?,?> context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addRealValues(Collection<?> values)
Adds the provided real values to the database, implements ADD modification.void
addValues(Collection<T> values)
T
convertRealValue(Object realValue)
Default conversion for one value is a mere type cast, override as necessary.abstract void
delete()
Resets the database columns or deletes sub-entities like refs, containers, etc.void
deleteRealValues(Collection<?> values)
Adds the provided real values to the database, implements ADD modification.void
deleteValues(Collection<T> values)
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.
-
-
-
Field Detail
-
context
protected final SqaleUpdateContext<?,?,?> context
-
-
Constructor Detail
-
ItemDeltaValueProcessor
protected ItemDeltaValueProcessor(SqaleUpdateContext<?,?,?> context)
-
-
Method Detail
-
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 ofdeleteRealValues(java.util.Collection<?>)
andaddRealValues(java.util.Collection<?>)
are independent, it's not usable for array update where a single `SET` clause is allowed.- Specified by:
process
in interfaceItemDeltaProcessor
- Throws:
RepositoryException
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.
-
-