Class QReferenceMapping<Q extends QReference<R,OR>,R extends MReference,OQ extends FlexibleRelationalPathBase<OR>,OR>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping<S,Q,R>
-
- com.evolveum.midpoint.repo.sqlbase.mapping.QueryTableMapping<S,Q,R>
-
- com.evolveum.midpoint.repo.sqale.mapping.SqaleTableMapping<Referencable,Q,R>
-
- com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping<Q,R,OQ,OR>
-
- Type Parameters:
Q
- type of entity path for the reference tableR
- row type related to theQReferenceMapping
OQ
- query type of the reference ownerOR
- row type of the reference owner (related toQReferenceMapping
)
- All Implemented Interfaces:
QOwnedByMapping<Referencable,R,OR>
,SqaleMappingMixin<Referencable,Q,R>
- Direct Known Subclasses:
QAccessCertificationWorkItemReferenceMapping
,QAssignmentReferenceMapping
,QCaseWorkItemReferenceMapping
,QObjectReferenceMapping
public class QReferenceMapping<Q extends QReference<R,OR>,R extends MReference,OQ extends FlexibleRelationalPathBase<OR>,OR> extends SqaleTableMapping<Referencable,Q,R> implements QOwnedByMapping<Referencable,R,OR>
Base mapping betweenQReference
subclasses andObjectReferenceType
. See subtypes for mapping instances for specific tables and seeMReferenceType
as well.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ALIAS_NAME
-
Fields inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QReferenceMapping(String tableName, String defaultAliasName, Class<Q> queryType, @NotNull SqaleRepoContext repositoryContext, @NotNull RefTableTargetResolver<Q,R,TQ,TR> targetResolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BiFunction<OQ,Q,com.querydsl.core.types.Predicate>
correlationPredicate()
Returns a bi-function that constructs correlation query predicate for owner and reference.static QReferenceMapping<?,?,?,?>
init(@NotNull SqaleRepoContext repositoryContext)
R
insert(Referencable reference, OR ownerRow, JdbcSession jdbcSession)
There is no need to override this, only reference creation is different and that is covered bynewRowObject(Object)
including setting FK columns.protected Q
newAliasInstance(String alias)
Method returning new instance ofEntityPath
- to be implemented by sub-mapping.R
newRowObject(OR ownerRow)
Defines a contract for creating the reference for the provided owner row.-
Methods inherited from class com.evolveum.midpoint.repo.sqale.mapping.SqaleTableMapping
addExtensionMapping, binaryMapper, booleanMapper, createFullObject, createRowTransformer, enumMapper, fullObjectItemsToSkip, insert, integerMapper, multiPolyStringMapper, multiStringMapper, multiUriMapper, multiValueMapper, needsInitialization, objectReference, objectReference, objectTypeToQName, parseSchemaObject, parseSchemaObject, polyStringMapper, processCacheableRelation, processCacheableUri, processCacheableUri, processCacheableUris, processExtensionColumns, processExtensions, repositoryContext, resolveIdToUri, resolveReferenceNames, resolveUriIdToQName, schemaTypeToObjectType, setPolyString, setReference, storeRefs, stringMapper, stringsToArray, timestampMapper, toSchemaObject, toSchemaObject, toSchemaObjectComplete, toSchemaObjectCompleteSafe, toSchemaObjectInternal, uriMapper, uuidMapper
-
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryTableMapping
addDetailFetchMapper, addExtensionColumn, defaultAlias, defaultAliasName, detailFetchMappers, getExtensionColumns, joinOn, longMapper, newAlias, newRowObject, prismContext, selectExpressions, selectExpressionsWithCustomColumns, tableName, toString, updateGetOptions
-
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
addItemMapping, addRelationResolver, getItemMapper, getItemMappings, getRelationResolver, itemDefinition, itemMapper, queryType, relationResolver, schemaType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.repo.sqale.mapping.SqaleMappingMixin
addAuditRefMapping, addContainerTableMapping, addItemMapping, addNestedMapping, addRefMapping, addRefMapping, addRelationResolver, afterModify, queryType
-
-
-
-
Field Detail
-
DEFAULT_ALIAS_NAME
public static final String DEFAULT_ALIAS_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QReferenceMapping
protected QReferenceMapping(String tableName, String defaultAliasName, Class<Q> queryType, @NotNull @NotNull SqaleRepoContext repositoryContext, @NotNull @NotNull RefTableTargetResolver<Q,R,TQ,TR> targetResolver)
-
-
Method Detail
-
init
public static QReferenceMapping<?,?,?,?> init(@NotNull @NotNull SqaleRepoContext repositoryContext)
-
newAliasInstance
protected Q newAliasInstance(String alias)
Description copied from class:QueryTableMapping
Method returning new instance ofEntityPath
- to be implemented by sub-mapping. This will create entity path without any extension columns, seeQueryTableMapping.newAlias(java.lang.String)
for that.- Specified by:
newAliasInstance
in classQueryTableMapping<Referencable,Q extends QReference<R,OR>,R extends MReference>
-
newRowObject
public R newRowObject(OR ownerRow)
Defines a contract for creating the reference for the provided owner row.- Specified by:
newRowObject
in interfaceQOwnedByMapping<Q extends QReference<R,OR>,R extends MReference,OQ extends FlexibleRelationalPathBase<OR>>
-
correlationPredicate
public BiFunction<OQ,Q,com.querydsl.core.types.Predicate> correlationPredicate()
Returns a bi-function that constructs correlation query predicate for owner and reference.
-
insert
public R insert(Referencable reference, OR ownerRow, JdbcSession jdbcSession)
There is no need to override this, only reference creation is different and that is covered bynewRowObject(Object)
including setting FK columns. All the other columns are based on a single schema type, so there is no variation.- Specified by:
insert
in interfaceQOwnedByMapping<Q extends QReference<R,OR>,R extends MReference,OQ extends FlexibleRelationalPathBase<OR>>
-
-