-
Notifications
You must be signed in to change notification settings - Fork 188
/
NestedContainerUpdateContext.java
57 lines (47 loc) · 1.77 KB
/
NestedContainerUpdateContext.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (C) 2010-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.repo.sqale.update;
import com.querydsl.core.types.Path;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.repo.sqale.qmodel.SqaleNestedMapping;
import com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping;
import com.evolveum.midpoint.repo.sqlbase.querydsl.FlexibleRelationalPathBase;
/**
* Update context for nested containers stored in the same table used by the parent context.
*
* @param <S> schema type of the object mapped by nested mapping
* @param <Q> entity query type that holds the data for the mapped attributes
* @param <R> row type related to the {@link Q}
*/
public class NestedContainerUpdateContext<S extends Containerable, Q extends FlexibleRelationalPathBase<R>, R>
extends SqaleUpdateContext<S, Q, R> {
private final SqaleNestedMapping<S, Q, R> mapping;
public NestedContainerUpdateContext(
SqaleUpdateContext<?, Q, R> parentContext,
SqaleNestedMapping<S, Q, R> mapping) {
super(parentContext, parentContext.row);
this.mapping = mapping;
}
@Override
public Q path() {
//noinspection unchecked
return (Q) parentContext.path();
}
@Override
public QueryModelMapping<S, Q, R> mapping() {
return mapping;
}
@Override
public <P extends Path<T>, T> void set(P path, T value) {
parentContext.set(path, value);
}
@Override
protected void finishExecutionOwn() {
// nothing to do, parent context has all the updates
System.out.println("NestedContainerUpdateContext EXECUTE");
}
}