public interface Result extends Iterable<Row>, JSONizable
CdsDataStore
.
Result
can be serialized to JSON and accessed as an Iterable
of Map
or in a typed way via an accessor interface.Modifier and Type | Method and Description |
---|---|
int |
batchCount()
Returns the number of batches.
|
Optional<Row> |
first()
Returns the first row.
|
<T> Optional<T> |
first(Class<T> type)
Returns the first row mapped to the given
type . |
long |
inlineCount()
Returns the total number of root entities matching the query as requested by
Select.inlineCount() . |
List<Row> |
list()
Returns a list of the result rows.
|
<T> List<T> |
listOf(Class<T> type)
Returns a list of the result rows mapped to the given
type . |
long |
rowCount()
Returns the number of rows affected or returned by the query.
|
long |
rowCount(int batch)
Returns the number of rows affected or returned by the query with the given
batch index.
|
CdsStructuredType |
rowType()
Returns the row type of this result.
|
Row |
single()
Returns the single row.
|
<T> T |
single(Class<T> type)
Returns the single row mapped to the given
type . |
Stream<Row> |
stream()
Returns a sequential
Stream of the result rows. |
<T> Stream<T> |
streamOf(Class<T> type)
Returns a sequential
Stream of the result rows mapped to the given
type . |
forEach, iterator, spliterator
toJson
Row single()
Row
EmptyResultException
- if the result is emptyNonUniqueResultException
- if the result contains more than one row<T> T single(Class<T> type)
type
.T
- the return typetype
- the type the row is mapped toT
EmptyResultException
- if the result is emptyNonUniqueResultException
- if the result contains more than one row<T> Optional<T> first(Class<T> type)
type
.T
- the type of the Optional
type
- the type the row is mapped toOptional
row mapped to T
Stream<Row> stream()
Stream
of the result rows.Stream
of rows<T> Stream<T> streamOf(Class<T> type)
Stream
of the result rows mapped to the given
type
.T
- the type of the Stream
type
- the type the result rows are mapped toStream
of the given type
<T> List<T> listOf(Class<T> type)
type
.T
- the type of the List
type
- the type the result rows are mapped totype
CdsStructuredType rowType()
long rowCount()
long rowCount(int batch)
batch
- the batch indexIndexOutOfBoundsException
- if the batch index is out of rangeint batchCount()
long inlineCount()
Select.inlineCount()
.Copyright © 2022 SAP. All rights reserved.