-
Notifications
You must be signed in to change notification settings - Fork 188
/
NestedMappingResolver.java
38 lines (32 loc) · 1.29 KB
/
NestedMappingResolver.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
/*
* 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.mapping;
import com.evolveum.midpoint.repo.sqale.SqaleUpdateContext;
import com.evolveum.midpoint.repo.sqlbase.SqlQueryContext;
import com.evolveum.midpoint.repo.sqlbase.mapping.QueryModelMapping;
import com.evolveum.midpoint.repo.sqlbase.querydsl.FlexibleRelationalPathBase;
/**
* Resolver that maps the nested items (next component of the path) to the same query type columns.
*
* @param <Q> type of source entity path
*/
public class NestedMappingResolver<Q extends FlexibleRelationalPathBase<?>>
implements SqaleItemRelationResolver {
private final QueryModelMapping<?, Q, ?> mapping;
public NestedMappingResolver(QueryModelMapping<?, Q, ?> mapping) {
this.mapping = mapping;
}
/** Returns the same context and nested mapping. */
@Override
public ResolutionResult resolve(SqlQueryContext<?, ?, ?> context) {
return new ResolutionResult(context, mapping);
}
@Override
public UpdateResolutionResult resolve(SqaleUpdateContext<?, ?, ?> context) {
return new UpdateResolutionResult(context, mapping);
}
}