Class QShadowMapping
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<S,Q,R>
com.evolveum.midpoint.repo.sqale.qmodel.object.QObjectMapping<ShadowType,QShadow,MShadow>
com.evolveum.midpoint.repo.sqale.qmodel.shadow.QShadowMapping
- All Implemented Interfaces:
SqaleMappingMixin<ShadowType,
QShadow, MShadow>
Mapping between
QShadow
and ShadowType
.-
Field Summary
Fields inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
logger
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizeFullObjectItemsToSkip
(PathSet mutableSet) static QShadowMapping
static QShadowMapping
initShadowMapping
(@NotNull SqaleRepoContext repositoryContext) protected QShadow
newAliasInstance
(String alias) Method returning new instance ofEntityPath
- to be implemented by sub-mapping.@NotNull com.querydsl.core.types.Path<?>[]
selectExpressions
(QShadow entity, Collection<SelectorOptions<GetOperationOptions>> options) By default, usesQueryTableMapping.selectExpressionsWithCustomColumns(Q)
and does not use options.void
storeRelatedEntities
(@NotNull MShadow row, @NotNull ShadowType shadow, @NotNull JdbcSession jdbcSession) Stores other entities related to the main object row like containers, references, etc.@NotNull MShadow
toRowObjectWithoutFullObject
(ShadowType shadow, JdbcSession jdbcSession) Override this to fill additional row attributes after calling this super version.toSchemaObject
(@NotNull com.querydsl.core.Tuple row, @NotNull QShadow entityPath, @NotNull JdbcSession jdbcSession, Collection<SelectorOptions<GetOperationOptions>> options) Transforms row Tuple containingSqaleTableMapping
under entity path and extension columns.updateGetOptions
(Collection<SelectorOptions<GetOperationOptions>> options, @NotNull Collection<? extends ItemDelta<?, ?>> modifications) Methods inherited from class com.evolveum.midpoint.repo.sqale.qmodel.object.QObjectMapping
addContainerTableMapping, addFullObjectContainerTableMapping, additionalSelectsByDefault, addRefMapping, createRowTransformer, definitionDerivation, definitionDerivationKey, fullObjectItemsToSkip, getObjectMapping, initObjectMapping, isReindexSupported, setFullObject, setStoreSplitted, toSchemaObjectCompleteSafe
Methods inherited from class com.evolveum.midpoint.repo.sqale.mapping.SqaleTableMapping
addExtensionMapping, binaryMapper, booleanMapper, createFullObject, doubleMapper, enumMapper, getDefinition, 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, toSchemaObjectComplete, toSchemaObjectInternal, uriMapper, uuidMapper
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryTableMapping
addDetailFetchMapper, addExtensionColumn, defaultAlias, defaultAliasName, detailFetchMappers, getExtensionColumns, joinOn, longMapper, newAlias, prismContext, selectExpressionsWithCustomColumns, tableName, toString
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, addExtensionMapping, addItemMapping, addNestedMapping, addRefMapping, addRelationResolver, afterModify, queryType
-
Field Details
-
DEFAULT_ALIAS_NAME
- See Also:
-
-
Method Details
-
initShadowMapping
public static QShadowMapping initShadowMapping(@NotNull @NotNull SqaleRepoContext repositoryContext) -
getShadowMapping
-
newAliasInstance
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.- Overrides:
newAliasInstance
in classQObjectMapping<ShadowType,
QShadow, MShadow>
-
newRowObject
- Overrides:
newRowObject
in classQObjectMapping<ShadowType,
QShadow, MShadow>
-
toRowObjectWithoutFullObject
@NotNull public @NotNull MShadow toRowObjectWithoutFullObject(ShadowType shadow, JdbcSession jdbcSession) Description copied from class:QObjectMapping
Override this to fill additional row attributes after calling this super version. *This must be called with active JDBC session* so it can create newQUri
rows. As this is intended for inserts *DO NOT* setMObject.objectType
to any value, it must be NULL otherwise the DB will complain about the value for the generated column. OID may be null, hence the method does NOT create any sub-entities, seeQObjectMapping.storeRelatedEntities(MObject, ObjectType, JdbcSession)
. Try to keep order of fields here, in M-class (MObject for this one) and in SQL the same.- Overrides:
toRowObjectWithoutFullObject
in classQObjectMapping<ShadowType,
QShadow, MShadow>
-
storeRelatedEntities
public void storeRelatedEntities(@NotNull @NotNull MShadow row, @NotNull @NotNull ShadowType shadow, @NotNull @NotNull JdbcSession jdbcSession) throws SchemaException Description copied from class:QObjectMapping
Stores other entities related to the main object row like containers, references, etc. This is not part ofQObjectMapping.toRowObjectWithoutFullObject(S, com.evolveum.midpoint.repo.sqlbase.JdbcSession)
because it requires known OID which is not assured before calling that method. *Always call this super method first in overriding methods.*- Overrides:
storeRelatedEntities
in classQObjectMapping<ShadowType,
QShadow, MShadow> - Parameters:
row
- master row for the added object("aggregate root")shadow
- schema objects for which the details are storedjdbcSession
- JDBC session used to insert related rows- Throws:
SchemaException
-
toSchemaObject
public ShadowType toSchemaObject(@NotNull @NotNull com.querydsl.core.Tuple row, @NotNull @NotNull QShadow entityPath, @NotNull @NotNull JdbcSession jdbcSession, Collection<SelectorOptions<GetOperationOptions>> options) throws SchemaException Description copied from class:SqaleTableMapping
Transforms row Tuple containingSqaleTableMapping
under entity path and extension columns. While public, for Sqale repo it should only be called for internal mapping purposes. *Do not call this in result list transformers* because the results would not have resolved reference names (if requested). Notice that the default implementation ofQueryTableMapping.createRowTransformer(com.evolveum.midpoint.repo.sqlbase.SqlQueryContext<S, Q, R>, com.evolveum.midpoint.repo.sqlbase.JdbcSession, java.util.Collection<com.evolveum.midpoint.schema.SelectorOptions<com.evolveum.midpoint.schema.GetOperationOptions>>)
in this class callsSqaleTableMapping.toSchemaObjectCompleteSafe(com.querydsl.core.Tuple, Q, java.util.Collection<com.evolveum.midpoint.schema.SelectorOptions<com.evolveum.midpoint.schema.GetOperationOptions>>, com.evolveum.midpoint.repo.sqlbase.JdbcSession, boolean)
which is the right thing to call in result list transformers.- Overrides:
toSchemaObject
in classQObjectMapping<ShadowType,
QShadow, MShadow> - Throws:
SchemaException
-
updateGetOptions
public Collection<SelectorOptions<GetOperationOptions>> updateGetOptions(Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull Collection<? extends ItemDelta<?, ?>> modifications) - Overrides:
updateGetOptions
in classQueryTableMapping<ShadowType,
QShadow, MShadow>
-
selectExpressions
@NotNull public @NotNull com.querydsl.core.types.Path<?>[] selectExpressions(QShadow entity, Collection<SelectorOptions<GetOperationOptions>> options) Description copied from class:QueryTableMapping
By default, usesQueryTableMapping.selectExpressionsWithCustomColumns(Q)
and does not use options. Can be overridden to fulfil other needs, e.g. to select just full object.- Overrides:
selectExpressions
in classQObjectMapping<ShadowType,
QShadow, MShadow>
-
customizeFullObjectItemsToSkip
- Overrides:
customizeFullObjectItemsToSkip
in classQObjectMapping<ShadowType,
QShadow, MShadow>
-
getPartitionManager
- Overrides:
getPartitionManager
in classSqaleTableMapping<ShadowType,
QShadow, MShadow> - Returns:
- Partition manager if table support partitioning
-