Class SqaleNestedMapping<S,Q extends FlexibleRelationalPathBase<R>,R>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping<S,Q,R>
-
- com.evolveum.midpoint.repo.sqale.mapping.SqaleNestedMapping<S,Q,R>
-
- Type Parameters:
S
- schema type for the nested containerQ
- type of entity pathR
- row type related to theSqaleNestedMapping
- All Implemented Interfaces:
SqaleMappingMixin<S,Q,R>
public class SqaleNestedMapping<S,Q extends FlexibleRelationalPathBase<R>,R> extends QueryModelMapping<S,Q,R> implements SqaleMappingMixin<S,Q,R>
Sqale implementation for nested mapping with support for sqale specific types. This allows for fluent calls of methods likeaddRefMapping(javax.xml.namespace.QName, com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping<TQ, TR, Q, R>)
which depend on sqale-specific types likeQReferenceMapping
in this example. This extends from sqlbaseQueryModelMapping
because this is NOT whole table mapping so it can't extend fromSqaleTableMapping
.
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SqaleNestedMapping(@NotNull Class<S> schemaType, @NotNull Class<Q> queryType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqaleNestedMapping<S,Q,R>
addItemMapping(@NotNull QName itemName, @NotNull ItemSqlMapper<Q,R> itemMapper)
Adds information how item (attribute) from schema type is mapped to query, especially for condition creating purposes.<TQ extends QReference<TR,R>,TR extends MReference>
SqaleNestedMapping<S,Q,R>addRefMapping(@NotNull QName itemName, @NotNull QReferenceMapping<TQ,TR,Q,R> referenceMapping)
Defines multi-value reference mapping (refs in table) for both query and modifications.<TS,TQ extends QObject<TR>,TR extends MObject>
SqaleNestedMapping<S,Q,R>addRefMapping(@NotNull QName itemName, @NotNull Function<Q,UuidPath> rootToOidPath, @NotNull Function<Q,com.querydsl.core.types.dsl.EnumPath<MObjectType>> rootToTypePath, @NotNull Function<Q,com.querydsl.core.types.dsl.NumberPath<Integer>> rootToRelationIdPath, @NotNull Supplier<QueryTableMapping<TS,TQ,TR>> targetMappingSupplier)
Defines single-value reference mapping for both query and modifications, columns embedded in the table.-
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
addRelationResolver, getItemMapper, getItemMappings, getRelationResolver, itemDefinition, itemMapper, queryType, relationResolver, schemaType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.repo.sqale.mapping.SqaleMappingMixin
addAuditRefMapping, addContainerTableMapping, addNestedMapping, addRelationResolver, afterModify, queryType
-
-
-
-
Method Detail
-
addItemMapping
public SqaleNestedMapping<S,Q,R> addItemMapping(@NotNull @NotNull QName itemName, @NotNull @NotNull ItemSqlMapper<Q,R> itemMapper)
Description copied from class:QueryModelMapping
Adds information how item (attribute) from schema type is mapped to query, especially for condition creating purposes. This is not usable for complex item path resolution, seeQueryModelMapping.addRelationResolver(QName, ItemRelationResolver)
for that purpose. TheItemSqlMapper
works as a factory forFilterProcessor
that can processObjectFilter
related to theQName
specified as the first parameter. It is not possible to use filter processor directly because at the time of mapping specification we don't have the actual query path representing the entity or the column. These paths are non-static properties of query class instances. TheItemSqlMapper
also provides so called "primary mapping" to a column for ORDER BY part of the filter. But there can be additional column mappings specified as for some types (e.g. poly-strings) there may be other than 1-to-1 mapping. Construction of theItemSqlMapper
is typically simplified by static methods#mapper()
provided on various*ItemFilterProcessor
classes. This works as a "processor factory factory" and makes table mapping specification simpler.- Specified by:
addItemMapping
in interfaceSqaleMappingMixin<S,Q extends FlexibleRelationalPathBase<R>,R>
- Overrides:
addItemMapping
in classQueryModelMapping<S,Q extends FlexibleRelationalPathBase<R>,R>
- Parameters:
itemName
- item name from schema type (seeF_*
constants on schema types)itemMapper
- mapper wrapping the information about column mappings working also as a factory forFilterProcessor
-
addRefMapping
public <TQ extends QReference<TR,R>,TR extends MReference> SqaleNestedMapping<S,Q,R> addRefMapping(@NotNull @NotNull QName itemName, @NotNull @NotNull QReferenceMapping<TQ,TR,Q,R> referenceMapping)
Description copied from interface:SqaleMappingMixin
Defines multi-value reference mapping (refs in table) for both query and modifications.- Specified by:
addRefMapping
in interfaceSqaleMappingMixin<S,Q extends FlexibleRelationalPathBase<R>,R>
-
addRefMapping
public <TS,TQ extends QObject<TR>,TR extends MObject> SqaleNestedMapping<S,Q,R> addRefMapping(@NotNull @NotNull QName itemName, @NotNull @NotNull Function<Q,UuidPath> rootToOidPath, @NotNull @NotNull Function<Q,com.querydsl.core.types.dsl.EnumPath<MObjectType>> rootToTypePath, @NotNull @NotNull Function<Q,com.querydsl.core.types.dsl.NumberPath<Integer>> rootToRelationIdPath, @NotNull @NotNull Supplier<QueryTableMapping<TS,TQ,TR>> targetMappingSupplier)
Description copied from interface:SqaleMappingMixin
Defines single-value reference mapping for both query and modifications, columns embedded in the table.- Specified by:
addRefMapping
in interfaceSqaleMappingMixin<S,Q extends FlexibleRelationalPathBase<R>,R>
-
-