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
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 Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ItemDeltaValueProcessor
(SqaleUpdateContext<?, ?, ?> context) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRealValue
(T realValue) void
addRealValues
(Collection<?> values) Adds the provided real values to the database, implements ADD modification.void
addValues
(Collection<T> values) 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.protected void
deleteRealValue
(T realValue) void
deleteRealValues
(Collection<?> values) Adds the provided real values to the database, implements ADD modification.void
deleteValues
(Collection<T> values) protected void
modifyRealValue
(T realValue) void
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.protected boolean
-
Field Details
-
context
-
-
Constructor Details
-
ItemDeltaValueProcessor
-
-
Method Details
-
process
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
-
useRealDeltaApplyResults
protected boolean useRealDeltaApplyResults() -
modifyRealValue
- Throws:
SchemaException
-
deleteRealValue
-
addRealValue
- Throws:
SchemaException
-
convertRealValue
Default conversion for one value is a mere type cast, override as necessary. -
setRealValues
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
Adds the provided real values to the database, implements ADD modification.- Throws:
SchemaException
-
addValues
- Throws:
SchemaException
-
deleteRealValues
Adds the provided real values to the database, implements ADD modification. -
deleteValues
-
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.
-