use of com.evolveum.midpoint.repo.sql.data.common.ROperationResult in project midpoint by Evolveum.
the class OperationResultUpdate method handleItemDelta.
void handleItemDelta() {
if (!(object instanceof ROperationResult)) {
throw new SystemException("Bean is not instance of " + ROperationResult.class + ", shouldn't happen");
}
PrismValue value;
if (delta.isDelete()) {
value = null;
} else {
value = delta.getAnyValue();
}
MapperContext context = new MapperContext();
context.setRepositoryContext(beans.createRepositoryContext());
context.setDelta(delta);
context.setOwner(object);
if (value != null) {
beans.prismEntityMapper.mapPrismValue(value, ROperationResult.class, context);
} else {
// todo clean this up
// we know that mapper supports mapping null value, but still this code smells
Mapper mapper = beans.prismEntityMapper.getMapper(OperationResultType.class, ROperationResult.class);
// noinspection unchecked
mapper.map(null, context);
}
}
Aggregations