Class ItemSqlMapper
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqlbase.mapping.item.ItemSqlMapper
-
public class ItemSqlMapper extends Object
Declarative information how an item (from schema/prism world) is to be processed when interpreting query. As this is declarative it does not point to any Q-class attributes - instead it knows how to get to the attributes when the Q-class instance (entity path) is provided; this is provided as a function (or functions for multiple paths), typically as lambdas. Based on this information the mapper can later createFilterProcessor
when needed, again providing the right type ofFilterProcessor
, based on the type of the item and/or how the item is mapped to the database.
-
-
Constructor Summary
Constructors Constructor Description ItemSqlMapper(@NotNull Function<SqlQueryContext<?,?,?>,ItemFilterProcessor<?>> filterProcessorFactory)
ItemSqlMapper(@NotNull Function<SqlQueryContext<?,?,?>,ItemFilterProcessor<?>> filterProcessorFactory, @Nullable Function<com.querydsl.core.types.EntityPath<?>,P> primaryItemMapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends ObjectFilter>
ItemFilterProcessor<T>createFilterProcessor(SqlQueryContext<?,?,?> sqlQueryContext)
CreatesItemFilterProcessor
based on this mapping.@Nullable com.querydsl.core.types.Path<?>
itemPrimaryPath(com.querydsl.core.types.EntityPath<?> root)
-
-
-
Constructor Detail
-
ItemSqlMapper
public ItemSqlMapper(@NotNull @NotNull Function<SqlQueryContext<?,?,?>,ItemFilterProcessor<?>> filterProcessorFactory, @Nullable @Nullable Function<com.querydsl.core.types.EntityPath<?>,P> primaryItemMapping)
-
ItemSqlMapper
public ItemSqlMapper(@NotNull @NotNull Function<SqlQueryContext<?,?,?>,ItemFilterProcessor<?>> filterProcessorFactory)
-
-
Method Detail
-
itemPrimaryPath
@Nullable public @Nullable com.querydsl.core.types.Path<?> itemPrimaryPath(com.querydsl.core.types.EntityPath<?> root)
-
createFilterProcessor
public <T extends ObjectFilter> ItemFilterProcessor<T> createFilterProcessor(SqlQueryContext<?,?,?> sqlQueryContext)
CreatesItemFilterProcessor
based on this mapping. ProvidedSqlQueryContext
is used to figure out the query paths when this is executed (as the entity path instance is not yet available when the mapping is configured in a declarative manner). The type of the returned filter is adapted to the client code needs for convenience.
-
-