Class QObjectReferenceFullObjectMapping<OS extends ObjectType,OQ extends QObject<OR>,OR extends MObject>
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<ObjectReferenceType,Q,R>
com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping<QObjectReference<OR>,MReference,OQ,OR>
com.evolveum.midpoint.repo.sqale.qmodel.ref.QObjectReferenceMapping<OS,OQ,OR>
com.evolveum.midpoint.repo.sqale.qmodel.ref.QObjectReferenceFullObjectMapping<OS,OQ,OR>
- All Implemented Interfaces:
QOwnedByMapping<ObjectReferenceType,
,MReference, OR> SqaleMappingMixin<ObjectReferenceType,
,QObjectReference<OR>, MReference> QSeparatelySerializedItem<QObjectReferenceWithMeta<OR>,
MReference>
public class QObjectReferenceFullObjectMapping<OS extends ObjectType,OQ extends QObject<OR>,OR extends MObject>
extends QObjectReferenceMapping<OS,OQ,OR>
implements QSeparatelySerializedItem<QObjectReferenceWithMeta<OR>,MReference>
-
Field Summary
Fields inherited from class com.evolveum.midpoint.repo.sqale.qmodel.ref.QObjectReferenceMapping
instanceArchetype, instanceCreateApprover, instanceDelegated, instanceEffectiveMark, instanceInclude, instanceModifyApprover, instanceParentOrg, instancePersona, instanceProjection, instanceResourceBusinessConfigurationApprover, instanceRoleMembership
Fields inherited from class com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping
DEFAULT_ALIAS_NAME, MAPPING_BY_OWNER_TYPE_AND_PATH, referencePath
Fields inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping
logger
-
Constructor Summary
ConstructorDescriptionQObjectReferenceFullObjectMapping
(Class<? extends ObjectType> baseType, ItemPath path, String tableName, String defaultAliasName, @NotNull SqaleRepoContext repositoryContext, @NotNull Supplier<QueryTableMapping<?, TQ, TR>> targetMappingSupplier, @Nullable Supplier<QueryTableMapping<OS, OQ, OR>> ownerMappingSupplier, @Nullable BiFunction<QObjectReference<OR>, OQ, com.querydsl.core.types.Predicate> ownerJoin, @Nullable Class<?> ownerType, @Nullable ItemPath referencePath) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterModify
(SqaleUpdateContext<ObjectReferenceType, QObjectReference<OR>, MReference> updateContext) Method called from `SqaleUpdateContext.finishExecutionOwn()` for containers.com.querydsl.core.types.Predicate
allOwnedBy
(QObjectReferenceWithMeta<OR> q, Collection<UUID> oidList) protected void
applyToOwner
(ObjectType owner, ObjectReferenceType candidate) <C extends Containerable>
byte[]com.querydsl.core.types.Path<?>[]
getOwner
(com.querydsl.core.Tuple row, QObjectReferenceWithMeta<OR> path) Class<? extends Item<? extends PrismValue,
?>> boolean
hasFullObject
(com.querydsl.core.Tuple row, QObjectReferenceWithMeta<OR> path) protected void
initRowObject
(MReference row, ObjectReferenceType reference) insert
(ObjectReferenceType reference, OR ownerRow, JdbcSession jdbcSession) There is no need to override this, only reference creation is different and that is covered byQReferenceMapping.newRowObject(Object)
including setting FK columns.protected QObjectReferenceWithMeta<OR>
newAliasInstance
(String alias) Method returning new instance ofEntityPath
- to be implemented by sub-mapping.newRowObject
(MObject ownerRow) Defines a contract for creating the reference for the provided owner row.com.querydsl.core.types.OrderSpecifier<?>
orderSpecifier
(QObjectReferenceWithMeta<OR> orqObjectReferenceWithMeta) protected boolean
requiresParent
(com.querydsl.core.Tuple t, QObjectReference<OR> entityPath) toSchemaObject
(MReference row) Transforms row ofQueryTableMapping
type to schema typeQueryTableMapping
.toSchemaObjectEmbedded
(com.querydsl.core.Tuple row, QObjectReferenceWithMeta<OR> alias) Methods inherited from class com.evolveum.midpoint.repo.sqale.qmodel.ref.QObjectReferenceMapping
correlationPredicate, createRowTransformer, getForArchetype, getForCreateApprover, getForDelegated, getForEffectiveMark, getForInclude, getForModifyApprover, getForParentOrg, getForPersona, getForProjection, getForResourceBusinessConfigurationApprover, getForRoleMembership, initForArchetype, initForCreateApprover, initForDelegated, initForEffectiveMark, initForInclude, initForModifyApprover, initForParentOrg, initForPersona, initForProjection, initForResourceBusinessConfigurationApprover, initForRoleMembership
Methods inherited from class com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping
getByOwnerTypeAndPath, init, registerByOwnerTypeAndPath
Methods inherited from class com.evolveum.midpoint.repo.sqale.mapping.SqaleTableMapping
addExtensionMapping, binaryMapper, booleanMapper, createFullObject, definitionDerivation, definitionDerivationKey, doubleMapper, enumMapper, fullObjectItemsToSkip, getDefinition, getPartitionManager, insert, integerMapper, multiPolyStringMapper, multiStringMapper, multiUriMapper, multiValueMapper, needsInitialization, objectReference, objectReference, objectTypeToQName, parseSchemaObject, parseSchemaObject, polyStringMapper, preprocessCacheableUris, processCacheableRelation, processCacheableUri, processCacheableUri, processCacheableUris, processExtensionColumns, processExtensions, repositoryContext, resolveIdToUri, resolveReferenceNames, resolveUriIdToQName, schemaTypeToObjectType, setPolyString, setReference, storeRefs, stringMapper, stringsToArray, timestampMapper, toSchemaObject, toSchemaObjectComplete, toSchemaObjectCompleteSafe, toSchemaObjectInternal, uriMapper, uuidMapper
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.mapping.QueryTableMapping
addDetailFetchMapper, addExtensionColumn, appendPaths, defaultAlias, defaultAliasName, detailFetchMappers, getExtensionColumns, joinOn, longMapper, newAlias, newRowObject, paths, 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.qmodel.object.QSeparatelySerializedItem
tableName
Methods inherited from interface com.evolveum.midpoint.repo.sqale.mapping.SqaleMappingMixin
addAuditRefMapping, addContainerTableMapping, addExtensionMapping, addItemMapping, addNestedMapping, addRefMapping, addRefMapping, addRelationResolver, queryType
-
Constructor Details
-
QObjectReferenceFullObjectMapping
public QObjectReferenceFullObjectMapping(Class<? extends ObjectType> baseType, ItemPath path, String tableName, String defaultAliasName, @NotNull @NotNull SqaleRepoContext repositoryContext, @NotNull @NotNull Supplier<QueryTableMapping<?, TQ, TR>> targetMappingSupplier, @Nullable @Nullable Supplier<QueryTableMapping<OS, OQ, OR>> ownerMappingSupplier, @Nullable @Nullable BiFunction<QObjectReference<OR>, OQ, com.querydsl.core.types.Predicate> ownerJoin, @Nullable @Nullable Class<?> ownerType, @Nullable @Nullable ItemPath referencePath)
-
-
Method Details
-
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 classQObjectReferenceMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject>
-
newRowObject
Description copied from class:QReferenceMapping
Defines a contract for creating the reference for the provided owner row.- Specified by:
newRowObject
in interfaceQOwnedByMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject> - Overrides:
newRowObject
in classQObjectReferenceMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject>
-
initRowObject
- Overrides:
initRowObject
in classQReferenceMapping<QObjectReference<OR extends MObject>,
MReference, OQ extends QObject<OR>, OR extends MObject> - Throws:
SchemaException
-
createFullObject
public <C extends Containerable> byte[] createFullObject(ObjectReferenceType ref) throws SchemaException - Throws:
SchemaException
-
insert
public MReference insert(ObjectReferenceType reference, OR ownerRow, JdbcSession jdbcSession) throws SchemaException Description copied from class:QReferenceMapping
There is no need to override this, only reference creation is different and that is covered byQReferenceMapping.newRowObject(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<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject> - Overrides:
insert
in classQReferenceMapping<QObjectReference<OR extends MObject>,
MReference, OQ extends QObject<OR>, OR extends MObject> - Throws:
SchemaException
-
afterModify
public void afterModify(SqaleUpdateContext<ObjectReferenceType, QObjectReference<OR>, throws SchemaExceptionMReference> updateContext) Description copied from interface:SqaleMappingMixin
Method called from `SqaleUpdateContext.finishExecutionOwn()` for containers. This can be handy when more than just column set is required, e.g. to refresh fullObject, etc.- Specified by:
afterModify
in interfaceSqaleMappingMixin<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject> - Overrides:
afterModify
in classQObjectReferenceMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject> - Throws:
SchemaException
-
hasFullObject
- Specified by:
hasFullObject
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
fullObjectExpressions
- Specified by:
fullObjectExpressions
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
getPrismItemType
- Specified by:
getPrismItemType
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
allOwnedBy
public com.querydsl.core.types.Predicate allOwnedBy(QObjectReferenceWithMeta<OR> q, Collection<UUID> oidList) - Specified by:
allOwnedBy
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
toSchemaObject
Description copied from class:QueryTableMapping
Transforms row ofQueryTableMapping
type to schema typeQueryTableMapping
. If pre-generated bean is used as row it does not include extension (dynamic) columns, which is OK if extension columns are used only for query and their information is still contained in the object somehow else (e.g. full object LOB). Alternative is to dynamically generate the list of select expressions reading directly from theTuple
- seeQueryTableMapping.toSchemaObject(Tuple, FlexibleRelationalPathBase, JdbcSession, Collection)
.- Overrides:
toSchemaObject
in classSqaleTableMapping<ObjectReferenceType,
QObjectReference<OR extends MObject>, MReference> - Throws:
SchemaException
-
toSchemaObjectEmbedded
public PrismReferenceValue toSchemaObjectEmbedded(com.querydsl.core.Tuple row, QObjectReferenceWithMeta<OR> alias) throws SchemaException - Specified by:
toSchemaObjectEmbedded
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>> - Throws:
SchemaException
-
getOwner
- Specified by:
getOwner
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
createAlias
- Specified by:
createAlias
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
getItemPath
- Specified by:
getItemPath
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-
requiresParent
- Overrides:
requiresParent
in classQObjectReferenceMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject>
-
applyToOwner
- Overrides:
applyToOwner
in classQObjectReferenceMapping<OS extends ObjectType,
OQ extends QObject<OR>, OR extends MObject> - Throws:
SchemaException
-
orderSpecifier
public com.querydsl.core.types.OrderSpecifier<?> orderSpecifier(QObjectReferenceWithMeta<OR> orqObjectReferenceWithMeta) - Specified by:
orderSpecifier
in interfaceQSeparatelySerializedItem<OS extends ObjectType,
OQ extends QObject<OR>>
-