Skip to content

Commit

Permalink
Fixed read of stored simulation deltas
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
  • Loading branch information
tonydamage committed Dec 8, 2022
1 parent cd11477 commit 9963c45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import javax.annotation.PreDestroy;

import com.evolveum.midpoint.prism.delta.ObjectDelta;

import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.schema.GetOperationOptions;
import com.evolveum.midpoint.schema.SearchResultList;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;

import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;
Expand Down Expand Up @@ -121,11 +122,15 @@ void storeProcessedObject(
/** TEMPORARY. Retrieves stored deltas. May be replaced by something more general in the future. */
@NotNull Collection<ObjectDelta<?>> getStoredDeltas(@NotNull String oid, OperationResult result)
throws SchemaException, ObjectNotFoundException {
SimulationResultType simResult = repository
ObjectQuery query = PrismContext.get().queryFor(SimulationResultProcessedObjectType.class)
.ownerId(oid)
.build();
/*SimulationResultType simResult = repository
.getObject(SimulationResultType.class, oid, GetOperationOptions.createRetrieveCollection(), result)
.asObjectable();
.asObjectable();*/
SearchResultList<SimulationResultProcessedObjectType> simResult = repository.searchContainers(SimulationResultProcessedObjectType.class, query, GetOperationOptions.createRetrieveCollection(), result);
Collection<ObjectDelta<?>> deltas = new ArrayList<>();
for (SimulationResultProcessedObjectType processedObject : simResult.getProcessedObject()) {
for (SimulationResultProcessedObjectType processedObject : simResult) {
ObjectDeltaType deltaBean = processedObject.getDelta();
if (deltaBean != null) {
deltas.add(DeltaConvertor.createObjectDelta(deltaBean));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected QSimulationResult newAliasInstance(String alias) {
JdbcSession jdbcSession) {
MSimulationResult row = super.toRowObjectWithoutFullObject(schemaObject, jdbcSession);

row.partitioned = schemaObject.isUseOwnPartitionForProcessedObjects();
//row.partitioned = schemaObject.isUseOwnPartitionForProcessedObjects();
return row;
}

Expand Down

0 comments on commit 9963c45

Please sign in to comment.