Package com.sap.cds.ql
Interface StructuredType<T extends StructuredType<T>>
-
- All Superinterfaces:
CqnSource
,CqnToken
,JSONizable
,Selectable
,Source<T>
public interface StructuredType<T extends StructuredType<T>> extends Source<T>, Selectable
Builder to define sets of structured CDS entities and types using filtered path expressions, to define predicates on these sets, and to address elements of structured types. Note that some methods in this interface mutually exclude each other and cannot be combined. For example, the methodsfilter
,filterByParams
, andmatching
all set the where condition of the enclosing statement, overwriting any previously stored conditions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CqnSelectListItem
_all()
Predicate
allMatch(CqnPredicate p)
Creates a predicate that tests whether all elements of the entity set referenced by this structured type match a given condition.Predicate
allMatch(Function<T,CqnPredicate> p)
Creates a predicate that tests whether all elements of the entity set referenced by this structured type match a given condition.Predicate
anyMatch(CqnPredicate p)
Creates a predicate that tests whether any instance of the entity set referenced by this structured type matches a given condition.Predicate
anyMatch(Function<T,CqnPredicate> p)
Creates a predicate that tests whether any instance of the entity set referenced by this structured type matches a given condition.StructuredType<T>
as(String alias)
Gives an alias to this structured type.StructuredTypeRef
asRef()
Casts this CQN source toCqnSelect
.Predicate
exists()
Creates a predicate that tests whether any instance of the entity set referenced by this structured type exists, i.e.Predicate
exists(Function<T,Select<?>> subQuery)
Expand<T>
expand()
Expand<T>
expand(Selectable... items)
Expand<T>
expand(Iterable<? extends Selectable> items)
Expand<T>
expand(String... refs)
default Expand<T>
expand(Function<T,? extends Selectable> item)
default Expand<T>
expand(Function<T,? extends Selectable>... items)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6)
default Expand<T>
expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6, Function<T,? extends Selectable> item7)
Expand<T>
expand(List<Function<T,? extends Selectable>> items)
T
filter(CqnPredicate p)
T
filter(Function<T,CqnPredicate> p)
default T
filterByParams(String... elementRefs)
T
filterByParams(Collection<String> elementRefs)
<E> ElementRef<E>
get(String path)
<E> ElementRef<E>
get(String path, Class<E> type)
CqnSelectListItem
inline()
CqnSelectListItem
inline(Selectable... items)
CqnSelectListItem
inline(Iterable<? extends Selectable> items)
CqnSelectListItem
inline(String... refs)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item)
default CqnSelectListItem
inline(Function<T,? extends Selectable>... items)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6)
default CqnSelectListItem
inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6, Function<T,? extends Selectable> item7)
CqnSelectListItem
inline(List<Function<T,? extends Selectable>> items)
T
matching(Map<String,?> values)
StructuredType<?>
to(String path)
<E extends StructuredType<E>>
Eto(String path, Class<E> type)
-
Methods inherited from interface com.sap.cds.ql.cqn.CqnSource
asJoin, asQuery, asSelect, isJoin, isQuery, isRef, isSelect
-
Methods inherited from interface com.sap.cds.JSONizable
toJson
-
-
-
-
Method Detail
-
to
StructuredType<?> to(String path)
-
to
<E extends StructuredType<E>> E to(String path, Class<E> type)
-
get
<E> ElementRef<E> get(String path)
-
get
<E> ElementRef<E> get(String path, Class<E> type)
-
filter
T filter(CqnPredicate p)
-
filter
T filter(Function<T,CqnPredicate> p)
-
anyMatch
Predicate anyMatch(Function<T,CqnPredicate> p)
Creates a predicate that tests whether any instance of the entity set referenced by this structured type matches a given condition. The filter condition is provided as a function that accepts a model object representing the entity referenced by this structured type and returning the filter condition.- Parameters:
p
- the condition to test for- Returns:
- the match predicate
-
anyMatch
Predicate anyMatch(CqnPredicate p)
Creates a predicate that tests whether any instance of the entity set referenced by this structured type matches a given condition.- Parameters:
p
- the condition to test for- Returns:
- the match predicate
-
allMatch
Predicate allMatch(Function<T,CqnPredicate> p)
Creates a predicate that tests whether all elements of the entity set referenced by this structured type match a given condition. The filter condition is provided as a function that accepts a model object representing the entity referenced by this structured type and returning the filter condition.- Parameters:
p
- the condition to test for- Returns:
- the match predicate
-
allMatch
Predicate allMatch(CqnPredicate p)
Creates a predicate that tests whether all elements of the entity set referenced by this structured type match a given condition.- Parameters:
p
- the condition to test for- Returns:
- the match predicate
-
exists
Predicate exists()
Creates a predicate that tests whether any instance of the entity set referenced by this structured type exists, i.e. the entity set referenced by this structured type is not empty.- Returns:
- the exists predicate
-
filterByParams
T filterByParams(Collection<String> elementRefs)
-
inline
CqnSelectListItem inline()
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6, Function<T,? extends Selectable> item7)
-
inline
default CqnSelectListItem inline(Function<T,? extends Selectable>... items)
-
inline
CqnSelectListItem inline(List<Function<T,? extends Selectable>> items)
-
inline
CqnSelectListItem inline(Iterable<? extends Selectable> items)
-
inline
CqnSelectListItem inline(Selectable... items)
-
inline
CqnSelectListItem inline(String... refs)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6)
-
expand
default Expand<T> expand(Function<T,? extends Selectable> item1, Function<T,? extends Selectable> item2, Function<T,? extends Selectable> item3, Function<T,? extends Selectable> item4, Function<T,? extends Selectable> item5, Function<T,? extends Selectable> item6, Function<T,? extends Selectable> item7)
-
expand
default Expand<T> expand(Function<T,? extends Selectable>... items)
-
expand
Expand<T> expand(Iterable<? extends Selectable> items)
-
expand
Expand<T> expand(Selectable... items)
-
_all
CqnSelectListItem _all()
-
asRef
StructuredTypeRef asRef()
Description copied from interface:CqnSource
Casts this CQN source toCqnSelect
.
-
as
StructuredType<T> as(String alias)
Gives an alias to this structured type.- Parameters:
alias
- the alias or null- Returns:
- this structured type
-
-