Package com.sap.cds.ql.cqn
Interface Modifier
public interface Modifier
Provider interface for modifying CQN
Predicates
,
Values
and Statements
copied with
CQL.copy
.
Override the default methods to replace specific parts of the statement /
predicate.-
Method Summary
Modifier and TypeMethodDescriptiondefault CqnPredicate
Override this method to replace abetween
predicate that that tests if thisvalue
is within a closed interval with given bounds oflow
andhigh
.default CqnPredicate
booleanFunction
(String name, List<Value<?>> args) Override this method to replace a predicatefunction
call.default CqnValue
caseExpression
(List<CqnCaseExpression.Case> cases, CqnValue defaultValue, String type) Override this method to replace ancase
expression.default CqnPredicate
comparison
(Value<?> lhs, CqnComparisonPredicate.Operator op, Value<?> rhs) Override this method to replace acomparison
predicate.default CqnPredicate
connective
(CqnConnectivePredicate.Operator op, List<Predicate> predicates) Override this method to replace a logicalconnection
predicate, which connects multiple predicates with the givenoperator
.default CqnPredicate
containment
(CqnContainmentTest.Position position, CqnValue value, CqnValue term, boolean caseInsensitive) Override this method to replace acontainment
test predicate.default boolean
distinct
(boolean distinct) default CqnPredicate
eTag
(CqnElementRef ref, CqnListValue values) Override this method to replace aeTag
predicate that checks if an ETag matches any value from the givenvalues
list.Override this method to modify theexclude list
ofSelect
statements.default CqnPredicate
Override this method to replace anexist
subquery.default CqnSelectListItem
Override this method to replaceexpand
lists.default CqnValue
expression
(Value<Number> left, CqnArithmeticExpression.Operator op, Value<Number> right, String type) Override this method to replace anarithmetic
expression.default CqnValue
Override this method to replace afunction
call.default CqnPredicate
default CqnPredicate
in
(CqnInSubquery inSubquery) Override this method to replace anin subquery
predicate that checks if the givenvalue
is equal to any value returned by the subquery.default CqnPredicate
Override this method to replace anin
predicate that checks if the givenvalue
is equal to any value in thevalueSet
.default CqnSelectListItem
Override this method to replaceinline
lists.default boolean
inlineCount
(boolean inlineCount) Override this method to set theinline count
flag ofSelect
statements.default List<CqnSelectListItem>
items
(List<CqnSelectListItem> items) default CqnValue
default CqnValue
literal
(CqnLiteral<?> value) default CqnPredicate
match
(CqnMatchPredicate match) Override this method to replace amatch
predicate.default CqnPredicate
Override this method to replace a logicalnegation
.default List<CqnSortSpecification>
orderBy
(List<CqnSortSpecification> sortSpecs) default CqnValue
parameter
(CqnParameter param) Override this method to replaceparameters
.default CqnPredicate
Override this method to replace asearch
predicate.default CqnValue
default CqnValue
ref
(CqnElementRef ref) default CqnStructuredTypeRef
ref
(CqnStructuredTypeRef ref) Override this method to replace astructured type ref
.default CqnPredicate
default CqnPredicate
Deprecated, for removal: This API element is subject to removal in a future version.searchableElements
(Set<String> searchableElements) Override this method to set thesearchable
elements ofSelect
statements.default CqnPredicate
searchTerm
(CqnSearchTermPredicate search) Override this method to replace asearch
predicate.default List<CqnSelectListItem>
default CqnSelectListItem
selectListValue
(SelectableValue value, String alias) default CqnSelectListItem
selectListValue
(Value<?> value, String alias) Deprecated, for removal: This API element is subject to removal in a future version.useselectListValue(SelectableValue, String)
insteaddefault long
skip
(long skip) default CqnSortSpecification
sort
(Value<?> value, CqnSortSpecification.Order order) default long
top
(long top) default CqnPredicate
Override this method to set thewhere
clause offilterable
statements.default CqnValue
windowFunction
(CqnWindowFunc func) Override this method to replace awindow function
call.
-
Method Details
-
ref
Override this method to replace astructured type ref
.- Parameters:
ref
- the immutableCqnStructuredTypeRef
- Returns:
- the replacement ref
- See Also:
-
ref
- Parameters:
ref
- the immutableCqnElementRef
- Returns:
- a
value
replacing the ref - See Also:
-
literal
- Parameters:
value
- the immutableCqnLiteral
value- Returns:
- a
value
replacing theCqnLiteral
- See Also:
-
parameter
Override this method to replaceparameters
.- Parameters:
param
- theCqnParameter
- Returns:
- a
CqnValue
replacing theparameter
-
plain
-
list
- Parameters:
values
- the list ofvalues
- Returns:
- a
CqnValue
replacing theCqnListValue
- See Also:
-
expression
default CqnValue expression(Value<Number> left, CqnArithmeticExpression.Operator op, Value<Number> right, String type) Override this method to replace anarithmetic
expression.- Parameters:
left
- the left-hand side of the expressionop
- the operatorright
- the right-hand side of the expressiontype
- the return type of the expression- Returns:
- a
CqnValue
replacing the arithmetic expression - See Also:
-
caseExpression
@Beta default CqnValue caseExpression(List<CqnCaseExpression.Case> cases, CqnValue defaultValue, String type) Override this method to replace ancase
expression.- Parameters:
cases
- the casesdefaultValue
- the default valuetype
- the return type of the expression- Returns:
- a
CqnValue
replacing the case expression
-
windowFunction
Override this method to replace awindow function
call.- Parameters:
func
- the window function- Returns:
- a
CqnValue
replacing the window function call
-
function
Override this method to replace afunction
call.- Parameters:
name
- the name of the functionargs
- the arguments of the functiontype
- the return type of the function call- Returns:
- a
CqnValue
replacing the function call - See Also:
-
booleanFunction
Override this method to replace a predicatefunction
call.- Parameters:
name
- the name of the functionargs
- the arguments of the function- Returns:
- a
CqnPredicate
replacing the Boolean function call - See Also:
-
comparison
Override this method to replace acomparison
predicate.- Parameters:
lhs
- the left-hand side of the comparisonop
- the comparison operatorrhs
- the right-hand side of the comparison- Returns:
- a
CqnPredicate
replacing the comparison - See Also:
-
in
Override this method to replace anin
predicate that checks if the givenvalue
is equal to any value in thevalueSet
.- Parameters:
value
- the value to be checked if it's contained in the setvalueSet
- thevalue set
- Returns:
- a
CqnPredicate
replacing theCqnInPredicate
- See Also:
-
in
Override this method to replace anin subquery
predicate that checks if the givenvalue
is equal to any value returned by the subquery.- Parameters:
inSubquery
- the in subquery predicate- Returns:
- a
CqnPredicate
replacing theCqnInSubquery
-
between
Override this method to replace abetween
predicate that that tests if thisvalue
is within a closed interval with given bounds oflow
andhigh
.- Parameters:
value
- the value to be checked if it's contained in a closed intervallow
- the lower boundhigh
- the upper bound- Returns:
- a
CqnPredicate
replacing theCqnBetweenPredicate
- See Also:
-
eTag
Override this method to replace aeTag
predicate that checks if an ETag matches any value from the givenvalues
list.- Parameters:
values
- the list of values- Returns:
- a
CqnPredicate
replacing theCqnEtagPredicate
-
connective
Override this method to replace a logicalconnection
predicate, which connects multiple predicates with the givenoperator
.- Parameters:
op
- the connective operator (AND
/OR
)predicates
- the list of connected predicates- Returns:
- a
CqnPredicate
replacing the logical connection - See Also:
-
negation
Override this method to replace a logicalnegation
.- Parameters:
predicate
- thepredicate
of the negation- Returns:
- a
CqnPredicate
replacing the negation - See Also:
-
exists
Override this method to replace anexist
subquery.- Parameters:
subQuery
- thequery
of the exists predicate- Returns:
- a
CqnPredicate
replacing theCqnExistsSubquery
- See Also:
-
match
Override this method to replace amatch
predicate.- Parameters:
match
- thematch
predicate- Returns:
- a
CqnPredicate
replacing theCqnMatchPredicate
- See Also:
-
containment
default CqnPredicate containment(CqnContainmentTest.Position position, CqnValue value, CqnValue term, boolean caseInsensitive) Override this method to replace acontainment
test predicate.- Parameters:
position
- theposition
value
- the stringvalue
term
- theterm
to test forcaseInsensitive
- whether the test should becase insensitive
- Returns:
- a
CqnPredicate
replacing theCqnContainmentTest
- See Also:
-
searchTerm
Override this method to replace asearch
predicate.- Parameters:
search
- the search term predicate- Returns:
- a
CqnPredicate
replacing theCqnSearchTermPredicate
- See Also:
-
search
Deprecated, for removal: This API element is subject to removal in a future version.usesearchTerm(CqnSearchTermPredicate)
instead -
passThroughSearch
Override this method to replace asearch
predicate.- Parameters:
search
- the pass-through search predicate- Returns:
- a
CqnPredicate
replacing theCqnPassThroughSearchPredicate
-
where
Override this method to set thewhere
clause offilterable
statements.- Parameters:
where
- thewhere
clause of the statement, or null- Returns:
- a
CqnPredicate
replacing the where clause
-
search
- Parameters:
search
- thesearch
clause of the statement, or null- Returns:
- a
CqnPredicate
replacing the search clause
-
searchableElements
Override this method to set thesearchable
elements ofSelect
statements.- Parameters:
searchableElements
- the searchable elements of the statement- Returns:
- the set of searchable elements
-
inline
Override this method to replaceinline
lists. UseCQL.to(segments).inline(items)
to create a newinline
.- Parameters:
inline
- theCqnInline
- Returns:
- a
CqnSelectListItem
replacing theinline
-
expand
Override this method to replaceexpand
lists. To create a new expand, useCQL.to(segments).expand(items)
. To create a modifiable copy of the expand, useCQL.copy(expand)
.- Parameters:
expand
- theCqnExpand
- Returns:
- a
CqnSelectListItem
replacing theexpand
-
selectListValue
- Parameters:
value
- the valuealias
- the alias- Returns:
- a
CqnSelectListItem
replacing thevalue
-
selectListValue
@Deprecated(since="3.7", forRemoval=true) default CqnSelectListItem selectListValue(Value<?> value, String alias) Deprecated, for removal: This API element is subject to removal in a future version.useselectListValue(SelectableValue, String)
instead -
selectAll
- Returns:
- a
CqnSelectListItem
replacing theasterisk
-
items
- Parameters:
items
- the list of selecteditems
- Returns:
- the new list of items
-
excluding
Override this method to modify theexclude list
ofSelect
statements.- Parameters:
excluding
- the names of the excluded elements- Returns:
- a set of names to be excluded from the Select result
-
groupBy
- Parameters:
values
- the groupBy list of the Select statement- Returns:
- a list of values to group by
-
having
- Parameters:
having
- the having clause of the Select statement- Returns:
- a
Predicate
replacing the having clause
-
orderBy
- Parameters:
sortSpecs
- the orderBy list of the Select statement- Returns:
- a list of
CqnSortSpecification
defining the order of the result
-
sort
- Parameters:
value
- the value of the sort specorder
- the sortorder
- Returns:
- a sort spec
- See Also:
-
distinct
default boolean distinct(boolean distinct) - Parameters:
distinct
- thedistinct
flag of the Select statement- Returns:
- the new
distinct
flag
-
inlineCount
default boolean inlineCount(boolean inlineCount) Override this method to set theinline count
flag ofSelect
statements.- Parameters:
inlineCount
- theinline count
flag of the Select statement- Returns:
- the new
inline count
flag
-
top
default long top(long top) - Parameters:
top
- thetop
limit of the Select statement- Returns:
- the new maximum number of rows to be selected or -1 for unlimited
-
skip
default long skip(long skip) - Parameters:
skip
- theskip
number of the Select statement- Returns:
- the new number of rows that shall be skipped
-
searchTerm(CqnSearchTermPredicate)
instead