Skip to content

Commit

Permalink
sqale: Added item mapping for container ID
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Oct 8, 2021
1 parent 4abcbad commit 0c3940b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.PrismConstants;
import com.evolveum.midpoint.repo.sqale.SqaleRepoContext;
import com.evolveum.midpoint.repo.sqale.delta.item.SinglePathItemDeltaProcessor;
import com.evolveum.midpoint.repo.sqale.mapping.QOwnedByMapping;
import com.evolveum.midpoint.repo.sqale.mapping.SqaleItemSqlMapper;
import com.evolveum.midpoint.repo.sqale.mapping.SqaleTableMapping;
import com.evolveum.midpoint.repo.sqlbase.JdbcSession;
import com.evolveum.midpoint.repo.sqlbase.filtering.item.SimpleItemFilterProcessor;
import com.evolveum.midpoint.util.exception.SchemaException;

/**
Expand Down Expand Up @@ -47,11 +51,16 @@ protected QContainerMapping(

// OWNER_OID does not need to be mapped, it is handled by InOidFilterProcessor
// CID is not mapped directly, it is used by path resolver elsewhere
addItemMapping(PrismConstants.T_ID, new SqaleItemSqlMapper<>(
ctx -> new SimpleItemFilterProcessor<>(ctx, p -> p.cid ),
ctx -> new SinglePathItemDeltaProcessor<>(ctx, p -> p.cid),
p -> p.cid));
}

/**
* Implemented for searchable containers that do not use fullObject for their recreation.
*/
@Override
public S toSchemaObject(R row) {
throw new UnsupportedOperationException(
"Container search not supported for schema type " + schemaType());
Expand Down

0 comments on commit 0c3940b

Please sign in to comment.