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 CqnPredicateOverride this method to replace abetweenpredicate that that tests if thisvalueis within a closed interval with given bounds oflowandhigh.default CqnPredicatebooleanFunction(String name, List<Value<?>> args) Override this method to replace a predicatefunctioncall.default CqnValuecaseExpression(List<CqnCaseExpression.Case> cases, CqnValue defaultValue, String type) Override this method to replace ancaseexpression.default CqnPredicatecomparison(Value<?> lhs, CqnComparisonPredicate.Operator op, Value<?> rhs) Override this method to replace acomparisonpredicate.default CqnPredicateconnective(CqnConnectivePredicate.Operator op, List<Predicate> predicates) Override this method to replace a logicalconnectionpredicate, which connects multiple predicates with the givenoperator.default CqnPredicatecontainment(CqnContainmentTest.Position position, CqnValue value, CqnValue term, boolean caseInsensitive) Override this method to replace acontainmenttest predicate.default booleandistinct(boolean distinct) default CqnPredicateeTag(CqnElementRef ref, CqnListValue values) Override this method to replace aeTagpredicate that checks if an ETag matches any value from the givenvalueslist.Override this method to modify theexclude listofSelectstatements.default CqnPredicateOverride this method to replace anexistsubquery.default CqnSelectListItemOverride this method to replaceexpandlists.default CqnValueexpression(Value<Number> left, CqnArithmeticExpression.Operator op, Value<Number> right, String type) Override this method to replace anarithmeticexpression.default CqnValueOverride this method to replace afunctioncall.default CqnPredicatedefault CqnPredicatein(CqnInSubquery inSubquery) Override this method to replace anin subquerypredicate that checks if the givenvalueis equal to any value returned by the subquery.default CqnPredicateOverride this method to replace aninpredicate that checks if the givenvalueis equal to any value in thevalueSet.default CqnSelectListItemOverride this method to replaceinlinelists.default booleaninlineCount(boolean inlineCount) Override this method to set theinline countflag ofSelectstatements.default List<CqnSelectListItem>items(List<CqnSelectListItem> items) default CqnValuedefault CqnValueliteral(CqnLiteral<?> value) default CqnPredicatematch(CqnMatchPredicate match) Override this method to replace amatchpredicate.default CqnPredicateOverride this method to replace a logicalnegation.default List<CqnSortSpecification>orderBy(List<CqnSortSpecification> sortSpecs) default CqnValueparameter(CqnParameter param) Override this method to replaceparameters.default CqnPredicateOverride this method to replace asearchpredicate.default CqnValuedefault CqnValueref(CqnElementRef ref) default CqnStructuredTypeRefref(CqnStructuredTypeRef ref) Override this method to replace astructured type ref.default CqnPredicatedefault CqnPredicateDeprecated, for removal: This API element is subject to removal in a future version.searchableElements(Set<String> searchableElements) Override this method to set thesearchableelements ofSelectstatements.default CqnPredicatesearchTerm(CqnSearchTermPredicate search) Override this method to replace asearchpredicate.default List<CqnSelectListItem>default CqnSelectListItemselectListValue(SelectableValue value, String alias) default CqnSelectListItemselectListValue(Value<?> value, String alias) Deprecated, for removal: This API element is subject to removal in a future version.useselectListValue(SelectableValue, String)insteaddefault longskip(long skip) default CqnSortSpecificationsort(Value<?> value, CqnSortSpecification.Order order) default longtop(long top) default CqnPredicateOverride this method to set thewhereclause offilterablestatements.default CqnValuewindowFunction(CqnWindowFunc func) Override this method to replace awindow functioncall.
-
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
valuereplacing the ref - See Also:
-
literal
- Parameters:
value- the immutableCqnLiteralvalue- Returns:
- a
valuereplacing theCqnLiteral - See Also:
-
parameter
Override this method to replaceparameters.- Parameters:
param- theCqnParameter- Returns:
- a
CqnValuereplacing theparameter
-
plain
-
list
- Parameters:
values- the list ofvalues- Returns:
- a
CqnValuereplacing theCqnListValue - See Also:
-
expression
default CqnValue expression(Value<Number> left, CqnArithmeticExpression.Operator op, Value<Number> right, String type) Override this method to replace anarithmeticexpression.- 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
CqnValuereplacing the arithmetic expression - See Also:
-
caseExpression
@Beta default CqnValue caseExpression(List<CqnCaseExpression.Case> cases, CqnValue defaultValue, String type) Override this method to replace ancaseexpression.- Parameters:
cases- the casesdefaultValue- the default valuetype- the return type of the expression- Returns:
- a
CqnValuereplacing the case expression
-
windowFunction
Override this method to replace awindow functioncall.- Parameters:
func- the window function- Returns:
- a
CqnValuereplacing the window function call
-
function
Override this method to replace afunctioncall.- Parameters:
name- the name of the functionargs- the arguments of the functiontype- the return type of the function call- Returns:
- a
CqnValuereplacing the function call - See Also:
-
booleanFunction
Override this method to replace a predicatefunctioncall.- Parameters:
name- the name of the functionargs- the arguments of the function- Returns:
- a
CqnPredicatereplacing the Boolean function call - See Also:
-
comparison
Override this method to replace acomparisonpredicate.- Parameters:
lhs- the left-hand side of the comparisonop- the comparison operatorrhs- the right-hand side of the comparison- Returns:
- a
CqnPredicatereplacing the comparison - See Also:
-
in
Override this method to replace aninpredicate that checks if the givenvalueis equal to any value in thevalueSet.- Parameters:
value- the value to be checked if it's contained in the setvalueSet- thevalue set- Returns:
- a
CqnPredicatereplacing theCqnInPredicate - See Also:
-
in
Override this method to replace anin subquerypredicate that checks if the givenvalueis equal to any value returned by the subquery.- Parameters:
inSubquery- the in subquery predicate- Returns:
- a
CqnPredicatereplacing theCqnInSubquery
-
between
Override this method to replace abetweenpredicate that that tests if thisvalueis within a closed interval with given bounds oflowandhigh.- Parameters:
value- the value to be checked if it's contained in a closed intervallow- the lower boundhigh- the upper bound- Returns:
- a
CqnPredicatereplacing theCqnBetweenPredicate - See Also:
-
eTag
Override this method to replace aeTagpredicate that checks if an ETag matches any value from the givenvalueslist.- Parameters:
values- the list of values- Returns:
- a
CqnPredicatereplacing theCqnEtagPredicate
-
connective
Override this method to replace a logicalconnectionpredicate, which connects multiple predicates with the givenoperator.- Parameters:
op- the connective operator (AND/OR)predicates- the list of connected predicates- Returns:
- a
CqnPredicatereplacing the logical connection - See Also:
-
negation
Override this method to replace a logicalnegation.- Parameters:
predicate- thepredicateof the negation- Returns:
- a
CqnPredicatereplacing the negation - See Also:
-
exists
Override this method to replace anexistsubquery.- Parameters:
subQuery- thequeryof the exists predicate- Returns:
- a
CqnPredicatereplacing theCqnExistsSubquery - See Also:
-
match
Override this method to replace amatchpredicate.- Parameters:
match- thematchpredicate- Returns:
- a
CqnPredicatereplacing theCqnMatchPredicate - See Also:
-
containment
default CqnPredicate containment(CqnContainmentTest.Position position, CqnValue value, CqnValue term, boolean caseInsensitive) Override this method to replace acontainmenttest predicate.- Parameters:
position- thepositionvalue- the stringvalueterm- thetermto test forcaseInsensitive- whether the test should becase insensitive- Returns:
- a
CqnPredicatereplacing theCqnContainmentTest - See Also:
-
searchTerm
Override this method to replace asearchpredicate.- Parameters:
search- the search term predicate- Returns:
- a
CqnPredicatereplacing 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 asearchpredicate.- Parameters:
search- the pass-through search predicate- Returns:
- a
CqnPredicatereplacing theCqnPassThroughSearchPredicate
-
where
Override this method to set thewhereclause offilterablestatements.- Parameters:
where- thewhereclause of the statement, or null- Returns:
- a
CqnPredicatereplacing the where clause
-
search
- Parameters:
search- thesearchclause of the statement, or null- Returns:
- a
CqnPredicatereplacing the search clause
-
searchableElements
Override this method to set thesearchableelements ofSelectstatements.- Parameters:
searchableElements- the searchable elements of the statement- Returns:
- the set of searchable elements
-
inline
Override this method to replaceinlinelists. UseCQL.to(segments).inline(items)to create a newinline.- Parameters:
inline- theCqnInline- Returns:
- a
CqnSelectListItemreplacing theinline
-
expand
Override this method to replaceexpandlists. 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
CqnSelectListItemreplacing theexpand
-
selectListValue
- Parameters:
value- the valuealias- the alias- Returns:
- a
CqnSelectListItemreplacing 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
CqnSelectListItemreplacing theasterisk
-
items
- Parameters:
items- the list of selecteditems- Returns:
- the new list of items
-
excluding
Override this method to modify theexclude listofSelectstatements.- 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
Predicatereplacing the having clause
-
orderBy
- Parameters:
sortSpecs- the orderBy list of the Select statement- Returns:
- a list of
CqnSortSpecificationdefining 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- thedistinctflag of the Select statement- Returns:
- the new
distinctflag
-
inlineCount
default boolean inlineCount(boolean inlineCount) Override this method to set theinline countflag ofSelectstatements.- Parameters:
inlineCount- theinline countflag of the Select statement- Returns:
- the new
inline countflag
-
top
default long top(long top) - Parameters:
top- thetoplimit 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- theskipnumber of the Select statement- Returns:
- the new number of rows that shall be skipped
-
searchTerm(CqnSearchTermPredicate)instead