public abstract class Select<T extends StructuredType<?>> extends Object implements Source<T>, CqnSelect
CdsDataStore
.Constructor and Description |
---|
Select() |
Modifier and Type | Method and Description |
---|---|
abstract Select<T> |
byId(Object idValue)
Sets the where condition of the select statement, requiring that the value of
the single key element of the target entity set is equal to the given
idValue.
|
Select<T> |
columns(CqnSelectListItem... items)
Sets the projection of the select statement.
|
Select<T> |
columns(Function<T,CqnSelectListItem>... items)
Sets the projection of the select statement.
|
abstract Select<T> |
columns(List<CqnSelectListItem> items)
Sets the projection of the select statement.
|
abstract Select<T> |
columns(Stream<CqnSelectListItem> items)
Sets the projection of the select statement.
|
abstract Select<T> |
columns(String... elements)
Sets the projection of the select statement.
|
static Select<StructuredType<?>> |
cqn(String cqnSelect)
Creates a select statement from a given CQN String.
|
abstract Select<T> |
distinct()
Specifies that duplicate query results should be eliminated.
|
Select<T> |
excluding(Function<T,CqnSelectListItem>... items)
Sets the exclude list of the select statement.
|
abstract Select<T> |
excluding(List<String> qualifiedNames)
Sets the exclude list of the select statement.
|
Select<T> |
excluding(String... qualifiedNames)
Sets the exclude list of the select statement.
|
static Select<StructuredType<?>> |
from(CdsEntity entity)
Creates a select statement to select entries from a specified entity set.
|
static Select<StructuredType<?>> |
from(CdsEntity entity,
UnaryOperator<StructuredType<?>> path)
Creates a select statement to select entries from a specified entity set.
|
static <E extends StructuredType<E>> |
from(Class<E> entity)
Creates a select statement to select entries from a specified entity set.
|
static <E extends StructuredType<E>,R extends StructuredType<R>> |
from(Class<E> entity,
Function<E,R> path)
Creates a select statement to select entries from a specified entity set.
|
static Select<StructuredType<?>> |
from(String qualifiedName)
Creates a select statement to select entries from a specified entity set.
|
static Select<StructuredType<?>> |
from(String entityName,
UnaryOperator<StructuredType<?>> path)
Creates a select statement to select entries from a specified entity set.
|
static <E extends StructuredType<E>> |
from(StructuredType<E> entity)
Creates a select statement to select entries from a specified entity set.
|
Select<T> |
groupBy(CqnElementRef... elements)
Sets the group by clause of the select statement.
|
Select<T> |
groupBy(Function<T,CqnSelectListItem>... items)
Sets the group by clause of the select statement.
|
abstract Select<T> |
groupBy(List<CqnSelectListItem> items)
Sets the group by clause of the select statement.
|
abstract Select<T> |
groupBy(String... elements)
Sets the groupBy clause of the select statement.
|
abstract Select<T> |
having(CqnPredicate pred)
Sets the having clause of the select statement.
|
abstract Select<T> |
having(Function<T,CqnPredicate> pred)
Sets the having clause of the select statement.
|
Select<T> |
limit(Function<T,Value<Integer>> rows)
Sets the limit of the select statement.
|
Select<T> |
limit(Function<T,Value<Integer>> rows,
Function<T,Value<Integer>> offset)
Sets the limit and offset of the select statement.
|
abstract Select<T> |
limit(int rows)
Sets the limit of the select statement.
|
abstract Select<T> |
limit(int rows,
int offset)
Sets the limit and offset of the select statement.
|
abstract Select<T> |
limit(Value<Integer> rows,
Value<Integer> offset)
Sets the limit and offset of the select statement.
|
abstract Select<T> |
matching(Map<String,?> values)
Sets the where condition of the select statement.
|
Select<T> |
orderBy(CqnSortSpecification... sortSpecs)
Sets the orderBy clause of the select statement.
|
Select<T> |
orderBy(Function<T,CqnSortSpecification>... sortSpecs)
Sets the orderBy clause of the select statement.
|
abstract Select<T> |
orderBy(List<CqnSortSpecification> sortSpecs)
Sets the orderBy clause of the select statement.
|
abstract Select<T> |
orderBy(String... elements)
Sets the orderBy clause of the select statement.
|
abstract Select<T> |
search(String searchTerm)
Adds a search filter to this select statement, requiring that any searchable element of the target entity set matches the given search term
|
abstract Select<T> |
search(String searchTerm,
List<String> searchableColumns)
Adds a search filter to this select statement, requiring that any searchable
element of the target entity set matches the given search term
|
String |
toString() |
abstract Select<T> |
where(CqnPredicate pred)
Sets the where condition of the select statement.
|
abstract Select<T> |
where(Function<T,CqnPredicate> pred)
Sets the where condition of the select statement.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
columns, excluding, from, groupBy, having, isDistinct, limit, orderBy, where
accept
toJson
public static Select<StructuredType<?>> from(String qualifiedName)
qualifiedName
- the fully qualified name of the CDS entity setpublic static <E extends StructuredType<E>> Select<E> from(StructuredType<E> entity)
entity
- the static model representation of the entity setpublic static Select<StructuredType<?>> from(String entityName, UnaryOperator<StructuredType<?>> path)
entityName
- the root entity name of the path expressionpath
- a path expression navigating from the root entity to the
target entity of the select statementpublic static Select<StructuredType<?>> from(CdsEntity entity)
entity
- the model representation of the entity set obtained by
reflectionCdsModel.findEntity(String)
,
CdsModel.entities()
public static Select<StructuredType<?>> from(CdsEntity entity, UnaryOperator<StructuredType<?>> path)
entity
- the model representation of the entity set obtained by
reflectionpath
- a path expression navigating from the root entity to the target
entity of the select statementCdsModel.findEntity(String)
,
CdsModel.entities()
public static <E extends StructuredType<E>> Select<E> from(Class<E> entity)
entity
- the static model representation of the entity setpublic static <E extends StructuredType<E>,R extends StructuredType<R>> Select<R> from(Class<E> entity, Function<E,R> path)
entity
- the static model representation of the entity setpath
- a path expression navigating from the root entity to the target
entity of the select statementpublic static Select<StructuredType<?>> cqn(String cqnSelect)
cqnSelect
- the CQN representation of the select statementpublic abstract Select<T> distinct()
@SafeVarargs public final Select<T> columns(CqnSelectListItem... items)
items
- the CqnSelectListItem(s)
that shall be
selected@SafeVarargs public final Select<T> columns(Function<T,CqnSelectListItem>... items)
items
- Function(s)
providing the
CqnSelectListItem(s)
that shall be
selectedpublic abstract Select<T> columns(List<CqnSelectListItem> items)
items
- the CqnSelectListItem(s)
that shall be
selectedpublic abstract Select<T> columns(Stream<CqnSelectListItem> items)
items
- the CqnSelectListItem(s)
that shall be
selectedpublic abstract Select<T> columns(String... elements)
elements
- the element(s) that shall be selectedpublic final Select<T> excluding(String... qualifiedNames)
qualifiedNames
- the items that shall be excluded from the projection@SafeVarargs public final Select<T> excluding(Function<T,CqnSelectListItem>... items)
items
- Function(s)
providing the
CqnSelectListItem(s)
that shall be
excluded from the projectionpublic abstract Select<T> excluding(List<String> qualifiedNames)
qualifiedNames
- the items that shall be excluded from the projectionpublic abstract Select<T> where(Function<T,CqnPredicate> pred)
pred
- a Function
providing the where conditionpublic abstract Select<T> where(CqnPredicate pred)
pred
- a CqnPredicate
public abstract Select<T> matching(Map<String,?> values)
CqnParameter
. The map entries are transformed into
equality predicates and joined via and.values
- the element name to value map defining the where conditionpublic abstract Select<T> byId(Object idValue)
idValue
- the value of the target entity's key elementpublic abstract Select<T> search(String searchTerm)
searchTerm
- the value to be searched forpublic abstract Select<T> search(String searchTerm, List<String> searchableColumns)
searchTerm
- the value to be searched forsearchableColumns
- columns to be searched inpublic final Select<T> groupBy(CqnElementRef... elements)
elements
- the elements the select shall be grouped by@SafeVarargs public final Select<T> groupBy(Function<T,CqnSelectListItem>... items)
items
- Function(s)
providing the
CqnSelectListItem(s)
the select shall
be grouped bypublic abstract Select<T> groupBy(List<CqnSelectListItem> items)
items
- the CqnSelectListItem(s)
the select
shall be grouped bypublic abstract Select<T> groupBy(String... elements)
elements
- the element(s) the select shall be grouped bypublic abstract Select<T> having(CqnPredicate pred)
pred
- the having predicate conditionpublic abstract Select<T> having(Function<T,CqnPredicate> pred)
pred
- Function(s)
providing the having predicate
condition@SafeVarargs public final Select<T> orderBy(Function<T,CqnSortSpecification>... sortSpecs)
sortSpecs
- Function(s)
providing the sort
specificationpublic final Select<T> orderBy(CqnSortSpecification... sortSpecs)
sortSpecs
- the sort specificationspublic abstract Select<T> orderBy(List<CqnSortSpecification> sortSpecs)
sortSpecs
- the sort specificationspublic abstract Select<T> orderBy(String... elements)
elements
- the elements defining the sort orderpublic abstract Select<T> limit(int rows)
rows
- the maximum number of rows returned by the querypublic abstract Select<T> limit(int rows, int offset)
rows
- the maximum number of rows returned by the queryoffset
- the number of rows that shall be skippedpublic final Select<T> limit(Function<T,Value<Integer>> rows, Function<T,Value<Integer>> offset)
rows
- Function(s)
providing the maximum number of
rows returned by the queryoffset
- Function(s)
providing the number of rows that
shall be skippedpublic final Select<T> limit(Function<T,Value<Integer>> rows)
rows
- Function(s)
providing the maximum number of rows
returned by the querypublic abstract Select<T> limit(Value<Integer> rows, Value<Integer> offset)
rows
- the maximum number of rows returned by the queryoffset
- the number of rows that shall be skippedCopyright © 2019 SAP. All rights reserved.