@Beta public interface Modifier extends CompatibilityDefaults
Predicates
,
Values
and Statements
copied with
CQL.copy
.
Override the default methods to replace specific parts of the statement /
predicate.CompatibilityDefaults.SPI<T>
Modifier and Type | Method and Description |
---|---|
default Predicate |
booleanFunction(String name,
List<Value<?>> args)
Override this method to replace a predicate
function
call. |
default Predicate |
comparison(Value<?> lhs,
CqnComparisonPredicate.Operator op,
Value<?> rhs)
Override this method to replace a
comparison
predicate. |
default Predicate |
connective(CqnConnectivePredicate.Operator op,
List<Predicate> predicates)
Override this method to replace a logical
connection predicate, which connects multiple predicates with the given
operator . |
default Predicate |
containment(CqnContainmentTest.Position position,
CqnValue value,
CqnValue term,
boolean caseInsensitive)
Override this method to replace a
containment test
predicate. |
default boolean |
distinct(boolean distinct)
|
default Set<String> |
excluding(Set<String> excluding)
Override this method to modify the
exclude list
of Select statements. |
default Predicate |
exists(Select<?> subQuery)
Override this method to replace an
exist subquery. |
default CqnSelectListItem |
expand(CqnExpand expand)
Override this method to replace
expand lists. |
default Value<?> |
expression(Value<Number> left,
CqnArithmeticExpression.Operator op,
Value<Number> right,
String type)
Override this method to replace an
arithmetic
expression. |
default Value<?> |
function(String name,
List<Value<?>> args,
String type)
Override this method to replace a
function call. |
default List<CqnValue> |
groupBy(List<CqnValue> values)
|
default CqnPredicate |
having(Predicate having)
|
default Predicate |
in(Value<?> value,
CqnValue valueSet)
Override this method to replace an
in predicate that
check if the given value is equal to any value in a valueSet . |
default CqnSelectListItem |
inline(CqnInline inline)
Override this method to replace
inline lists. |
default boolean |
inlineCount(boolean inlineCount)
Override this method to set the
inline
count flag of Select statements. |
default List<CqnSelectListItem> |
items(List<CqnSelectListItem> items)
|
default CqnValue |
list(List<Value<?>> values)
|
default CqnValue |
literal(CqnLiteral<?> value)
|
default CqnPredicate |
match(CqnMatchPredicate match)
Override this method to replace a
match predicate. |
default Predicate |
negation(Predicate predicate)
Override this method to replace a logical
negation . |
default List<CqnSortSpecification> |
orderBy(List<CqnSortSpecification> sortSpecs)
|
default Value<?> |
parameter(String name,
String cdsType) |
default Value<?> |
plain(String plain,
String cdsType) |
default CqnValue |
ref(CqnElementRef ref)
|
default CqnStructuredTypeRef |
ref(CqnStructuredTypeRef ref)
Override this method to replace a
structured type
ref . |
default Predicate |
search(Predicate search)
|
default Predicate |
search(String term)
Override this method to replace a
search
predicate. |
default Set<String> |
searchableElements(Set<String> searchableElements)
Override this method to set the
searchable
elements of Select statements. |
default List<CqnSelectListItem> |
selectAll()
|
default CqnSelectListItem |
selectListValue(Value<?> value,
String alias)
|
default long |
skip(long skip)
|
default CqnSortSpecification |
sort(Value<?> value,
CqnSortSpecification.Order order)
|
default long |
top(long top)
|
default Predicate |
where(Predicate where)
Override this method to set the
where
clause of filterable statements. |
_mutableCopy, expand, expand, in, inline, limit, match, ref, ref, selectListItem
default CqnStructuredTypeRef ref(CqnStructuredTypeRef ref)
structured type
ref
.ref
in interface CompatibilityDefaults
ref
- the immutable CqnStructuredTypeRef
CQL.to(segments).asRef() to create a new ref
,
CQL.copy(ref) to create a modifiable copy
of the ref
default CqnValue ref(CqnElementRef ref)
ref
in interface CompatibilityDefaults
ref
- the immutable CqnElementRef
value
replacing the refCQL.get(segments) to create a new ref
,
CQL.copy(ref) to create a modifiable copy of the
ref
default CqnValue literal(CqnLiteral<?> value)
value
- the immutable CqnLiteral
valuevalue
replacing the CqnLiteral
CQL.val(T)
,
CQL.constant(T)
default CqnValue list(List<Value<?>> values)
values
- the list of values
CqnValue
replacing the CqnListValue
CQL.list(java.util.List<? extends com.sap.cds.ql.cqn.CqnValue>)
default Value<?> expression(Value<Number> left, CqnArithmeticExpression.Operator op, Value<Number> right, String type)
arithmetic
expression.left
- the left-hand side of the expressionop
- the operatorright
- the right-hand side of the expressiontype
- the return type of the expressionValue
replacing the arithmetic expressionCQL.expression(com.sap.cds.ql.cqn.CqnValue, com.sap.cds.ql.cqn.CqnArithmeticExpression.Operator, com.sap.cds.ql.cqn.CqnValue)
default Value<?> function(String name, List<Value<?>> args, String type)
function
call.name
- the name of the functionargs
- the arguments of the functiontype
- the return type of the function callValue
replacing the function callCQL.func(java.lang.String, com.sap.cds.ql.cqn.CqnValue...)
default Predicate booleanFunction(String name, List<Value<?>> args)
function
call.name
- the name of the functionargs
- the arguments of the functionPredicate
replacing the Boolean function callCQL.booleanFunc(java.lang.String, java.util.List<? extends com.sap.cds.ql.cqn.CqnValue>)
default Predicate comparison(Value<?> lhs, CqnComparisonPredicate.Operator op, Value<?> rhs)
comparison
predicate.lhs
- the left-hand side of the comparisonop
- the comparison operatorrhs
- the right-hand side of the comparisonPredicate
replacing the comparisonCQL.comparison(com.sap.cds.ql.cqn.CqnValue, com.sap.cds.ql.cqn.CqnComparisonPredicate.Operator, com.sap.cds.ql.cqn.CqnValue)
default Predicate in(Value<?> value, CqnValue valueSet)
in
predicate that
check if the given value
is equal to any value in a valueSet
.in
in interface CompatibilityDefaults
value
- the value to be checked if it's contained in the setvalueSet
- the collection of values, usually a list
Predicate
replacing the CqnInPredicate
CQL.in(com.sap.cds.ql.cqn.CqnValue, java.util.Collection<? extends com.sap.cds.ql.cqn.CqnValue>)
default Predicate connective(CqnConnectivePredicate.Operator op, List<Predicate> predicates)
connection
predicate, which connects multiple predicates with the given
operator
.op
- the connective operator (AND
/OR
)predicates
- the list of connected predicatesPredicate
replacing the logical connectionCQL.connect(com.sap.cds.ql.cqn.CqnConnectivePredicate.Operator, java.lang.Iterable<? extends com.sap.cds.ql.cqn.CqnPredicate>)
,
CQL.and(com.sap.cds.ql.cqn.CqnPredicate, com.sap.cds.ql.cqn.CqnPredicate)
,
CQL.or(com.sap.cds.ql.cqn.CqnPredicate, com.sap.cds.ql.cqn.CqnPredicate)
default Predicate negation(Predicate predicate)
negation
.predicate
- the predicate
of the
negationPredicate
replacing the negationCQL.not(com.sap.cds.ql.cqn.CqnPredicate)
default Predicate exists(Select<?> subQuery)
exist
subquery.subQuery
- the query
of the exists
predicatePredicate
replacing the CqnExistsSubquery
CQL.exists(com.sap.cds.ql.cqn.CqnSelect)
default CqnPredicate match(CqnMatchPredicate match)
match
predicate.match
in interface CompatibilityDefaults
match
- the match
predicateCqnPredicate
replacing the CqnMatchPredicate
CQL.match(com.sap.cds.ql.cqn.CqnStructuredTypeRef, com.sap.cds.ql.cqn.CqnPredicate, com.sap.cds.ql.cqn.CqnMatchPredicate.Quantifier)
default Predicate containment(CqnContainmentTest.Position position, CqnValue value, CqnValue term, boolean caseInsensitive)
containment
test
predicate.position
- the position
value
- the string value
term
- the term
to test forcaseInsensitive
- whether the test should be
case
insensitive
Predicate
replacing the CqnContainmentTest
CQL.containment(com.sap.cds.ql.cqn.CqnContainmentTest.Position, com.sap.cds.ql.cqn.CqnValue, com.sap.cds.ql.cqn.CqnValue, boolean)
default Predicate search(String term)
search
predicate.term
- the search termPredicate
replacing the CqnSearchPredicate
CQL.search(java.lang.String)
default Predicate where(Predicate where)
where
clause of filterable
statements.where
- the where
clause of the statement, or nullPredicate
replacing the where clausedefault Predicate search(Predicate search)
search
- the search
clause of the statement, or nullPredicate
replacing the search clausedefault Set<String> searchableElements(Set<String> searchableElements)
searchable
elements of Select
statements.searchableElements
- the searchable elements of the statementdefault CqnSelectListItem inline(CqnInline inline)
inline
lists.
Use CQL.to(segments).inline(items)
to
create a new inline
.inline
in interface CompatibilityDefaults
inline
- the CqnInline
CqnSelectListItem
replacing the inline
default CqnSelectListItem expand(CqnExpand expand)
expand
lists.
To create a new expand, use CQL.to(segments).expand(items)
. To create a modifiable copy of the expand,
use CQL.copy(expand)
.expand
in interface CompatibilityDefaults
expand
- the CqnExpand
CqnSelectListItem
replacing the expand
@Beta default CqnSelectListItem selectListValue(Value<?> value, String alias)
selectListValue
in interface CompatibilityDefaults
value
- the valuealias
- the aliasCqnSelectListItem
replacing the value
default List<CqnSelectListItem> selectAll()
CqnSelectListItem
replacing the asterisk
default List<CqnSelectListItem> items(List<CqnSelectListItem> items)
items
- the list of selected items
default Set<String> excluding(Set<String> excluding)
exclude list
of Select
statements.excluding
- the names of the excluded elementsdefault List<CqnValue> groupBy(List<CqnValue> values)
values
- the groupBy list of the Select statement@Beta default CqnPredicate having(Predicate having)
having
- the having clause of the Select statementPredicate
replacing the having clausedefault List<CqnSortSpecification> orderBy(List<CqnSortSpecification> sortSpecs)
sortSpecs
- the orderBy list of the Select statementCqnSortSpecification
defining the order of the
resultdefault CqnSortSpecification sort(Value<?> value, CqnSortSpecification.Order order)
value
- the value of the sort specorder
- the sort order
CQL.sort(com.sap.cds.ql.cqn.CqnValue, com.sap.cds.ql.cqn.CqnSortSpecification.Order)
default boolean distinct(boolean distinct)
distinct
- the distinct
flag of the Select statementdistinct
flagdefault boolean inlineCount(boolean inlineCount)
inline
count
flag of Select
statements.inlineCount
- the inline count
flag of the Select statementinline count
flagdefault long top(long top)
top
- the top
limit of the Select statementdefault long skip(long skip)
skip
- the skip
number of the Select statementCopyright © 2023 SAP. All rights reserved.