Class RootUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sqale.update.SqaleUpdateContext<S,Q,R>
-
- com.evolveum.midpoint.repo.sqale.update.RootUpdateContext<S,Q,R>
-
- Type Parameters:
S
- schema typeQ
- type of entity pathR
- row type related to theRootUpdateContext
public class RootUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject> extends SqaleUpdateContext<S,Q,R>
Root context of the update context tree, seeSqaleUpdateContext
for more information.
-
-
Field Summary
Fields Modifier and Type Field Description protected QObjectMapping<S,Q,R>
mapping
-
Fields inherited from class com.evolveum.midpoint.repo.sqale.update.SqaleUpdateContext
jdbcSession, logger, parentContext, row, subcontexts
-
-
Constructor Summary
Constructors Constructor Description RootUpdateContext(SqaleRepoContext repositoryContext, JdbcSession jdbcSession, S object, R rootRow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Q
entityPath()
Returns entity path (table) for the context.Collection<? extends ItemDelta<?,?>>
execute(Collection<? extends ItemDelta<?,?>> modifications)
Applies modifications, executes necessary updates and returns narrowed modifications.Collection<? extends ItemDelta<?,?>>
execute(Collection<? extends ItemDelta<?,?>> modifications, boolean updateTables)
<O> O
findValueOrItem(@NotNull ItemPath path)
void
finishExecutionOwn()
Executes all necessary SQL updates (including sub-entity inserts/deletes) for the enclosedobject
.PrismObject<S>
getPrismObject()
boolean
isOverwrittenId(Long id)
QObjectMapping<S,Q,R>
mapping()
UUID
objectOid()
<P extends com.querydsl.core.types.Path<T>,T>
voidset(P path, com.querydsl.core.types.Expression<T> expression)
<P extends com.querydsl.core.types.Path<T>,T>
voidset(P path, T value)
<P extends com.querydsl.core.types.Path<T>,T>
voidsetNull(P path)
com.querydsl.sql.dml.SQLUpdateClause
update()
-
Methods inherited from class com.evolveum.midpoint.repo.sqale.update.SqaleUpdateContext
addSubcontext, findValueOrItem, finishExecution, getSubcontext, insertOwnedRow, jdbcSession, repositoryContext, row
-
-
-
-
Field Detail
-
mapping
protected final QObjectMapping<S extends ObjectType,Q extends QObject<R>,R extends MObject> mapping
-
-
Constructor Detail
-
RootUpdateContext
public RootUpdateContext(SqaleRepoContext repositoryContext, JdbcSession jdbcSession, S object, R rootRow)
-
-
Method Detail
-
entityPath
public Q entityPath()
Description copied from class:SqaleUpdateContext
Returns entity path (table) for the context. This is NOT the path for item column, which can be actually multiple columns (ref, poly) or just part of the value in the column (JSONB).- Specified by:
entityPath
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
mapping
public QObjectMapping<S,Q,R> mapping()
- Specified by:
mapping
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
execute
public Collection<? extends ItemDelta<?,?>> execute(Collection<? extends ItemDelta<?,?>> modifications) throws SchemaException, RepositoryException
Applies modifications, executes necessary updates and returns narrowed modifications. If returned narrowed modifications are empty, no update was made and version stays the same!- Throws:
SchemaException
RepositoryException
-
execute
public Collection<? extends ItemDelta<?,?>> execute(Collection<? extends ItemDelta<?,?>> modifications, boolean updateTables) throws SchemaException, RepositoryException
- Throws:
SchemaException
RepositoryException
-
finishExecutionOwn
public void finishExecutionOwn() throws SchemaException, RepositoryException
Executes all necessary SQL updates (including sub-entity inserts/deletes) for the enclosedobject
. This also increments the version information and serializes `fullObject`. This is made public for cases when we want to update full object even without modifications.- Specified by:
finishExecutionOwn
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
- Throws:
SchemaException
RepositoryException
-
findValueOrItem
public <O> O findValueOrItem(@NotNull @NotNull ItemPath path)
- Overrides:
findValueOrItem
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
isOverwrittenId
public boolean isOverwrittenId(Long id)
- Overrides:
isOverwrittenId
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
update
public com.querydsl.sql.dml.SQLUpdateClause update()
-
set
public <P extends com.querydsl.core.types.Path<T>,T> void set(P path, T value)
- Specified by:
set
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
set
public <P extends com.querydsl.core.types.Path<T>,T> void set(P path, com.querydsl.core.types.Expression<T> expression)
- Specified by:
set
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
setNull
public <P extends com.querydsl.core.types.Path<T>,T> void setNull(P path)
- Specified by:
setNull
in classSqaleUpdateContext<S extends ObjectType,Q extends QObject<R>,R extends MObject>
-
objectOid
public UUID objectOid()
-
getPrismObject
public PrismObject<S> getPrismObject()
-
-