Package com.sap.cds.util
Class ProjectionResolver<T extends CqnStatement>
java.lang.Object
com.sap.cds.util.ProjectionResolver<T>
Stateful implementation of projection resolver. Keeps track of statement that
was attempted to be resolved.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptioncondition
(ProjectionResolver.BiPredicate resolvedCondition) Adds theCondition
on which the projection is considered resolvedcondition
(ProjectionResolver.TriPredicate resolvedCondition) Adds theCondition
on which the projection is considered resolvedstatic <T extends CqnStatement>
ProjectionResolver<T>static <T extends CqnStatement>
ProjectionResolver<T>Returns the resolved statement.resolve()
Resolves the current statement against its next projection layer.Resolves any aliases from the statement to their original name.Resolves the statement against the views defined by the statements entity path and returns theProjectionResolver
object containing it.Transforms theResult
to structurally match the original statement.Transforms the list of entries to structurally match the original statement.
-
Method Details
-
create
-
create
public static <T extends CqnStatement> ProjectionResolver<T> create(CdsModel model, T statement, boolean aliasedQueries) -
condition
Adds theCondition
on which the projection is considered resolved- Parameters:
resolvedCondition
- theCondition
on which resolvement stops- Returns:
- the
ProjectionResolver instance
-
condition
Adds theCondition
on which the projection is considered resolved- Parameters:
resolvedCondition
- theCondition
on which resolvement stops- Returns:
- the
ProjectionResolver instance
-
resolveAll
Resolves the statement against the views defined by the statements entity path and returns theProjectionResolver
object containing it. The statement is resolved until theCondition
is not met. If the statement can't be resolved, the original statement is returned.- Returns:
- resolver object, containing the resolved statement, or the original one, if the projection could not be resolved.
-
resolveAliases
Resolves any aliases from the statement to their original name. If aliases are resolved the original projection can be restored by usingtransform(List)
ortransform(Result)
.- Returns:
- resolver object
-
resolve
Resolves the current statement against its next projection layer. It resolves projections in all refs contained in the statement. If the statement can't be resolved, the original statement is returned.- Returns:
ProjectionResolver
containing the resolved statement, or the original one, if the projection could not be resolved.
-
getResolvedStatement
Returns the resolved statement.- Returns:
- the resolved statement
-
transform
Transforms the list of entries to structurally match the original statement.- Parameters:
entries
- the execution result for the resolved statement to be transformed into the original representation- Returns:
- the transformed entries
-
transform
Transforms theResult
to structurally match the original statement. It also redetermines the row type of theResult
- Parameters:
result
- the execution result for the resolved statement to be transformed into the original representation- Returns:
- the transformed
Result
-