public static interface FluentQuery.FetchableFluentQuery<T> extends FluentQuery<T>
FluentQuery
allowing to materialize results from the underlying query.FluentQuery.FetchableFluentQuery<T>, FluentQuery.ReactiveFluentQuery<T>
Modifier and Type | Method and Description |
---|---|
List<T> |
all()
Get all matching elements.
|
<R> FluentQuery.FetchableFluentQuery<R> |
as(Class<R> resultType)
Define the target type the result should be mapped to.
|
long |
count()
Get the number of matching elements.
|
boolean |
exists()
Check for the presence of matching elements.
|
default Optional<T> |
first()
Get the first or no result.
|
T |
firstValue()
Get the first or no result.
|
default Optional<T> |
one()
Get exactly zero or one result.
|
T |
oneValue()
Get exactly zero or one result.
|
Page<T> |
page(Pageable pageable)
Get a page of matching elements for
Pageable . |
FluentQuery.FetchableFluentQuery<T> |
project(Collection<String> properties)
Define which properties or property paths to include in the query.
|
default FluentQuery.FetchableFluentQuery<T> |
project(String... properties)
Define which properties or property paths to include in the query.
|
FluentQuery.FetchableFluentQuery<T> |
sortBy(Sort sort)
Define the sort order.
|
Stream<T> |
stream()
Stream all matching elements.
|
FluentQuery.FetchableFluentQuery<T> sortBy(Sort sort)
FluentQuery
sortBy
in interface FluentQuery<T>
sort
- the Sort
specification to sort the results by, may be Sort.unsorted()
, must not be
null.FluentQuery
.<R> FluentQuery.FetchableFluentQuery<R> as(Class<R> resultType)
FluentQuery
as
in interface FluentQuery<T>
R
- result type.resultType
- must not be null
.FluentQuery
.default FluentQuery.FetchableFluentQuery<T> project(String... properties)
FluentQuery
project
in interface FluentQuery<T>
properties
- must not be null
.FluentQuery
.FluentQuery.FetchableFluentQuery<T> project(Collection<String> properties)
FluentQuery
project
in interface FluentQuery<T>
properties
- must not be null
.FluentQuery
.default Optional<T> one()
Optional.empty()
if no match found.IncorrectResultSizeDataAccessException
- if more than one match found.@Nullable T oneValue()
IncorrectResultSizeDataAccessException
- if more than one match found.default Optional<T> first()
Optional.empty()
if no match found.Page<T> page(Pageable pageable)
Pageable
.pageable
- the pageable to request a paged result, can be Pageable.unpaged()
, must not be
null. The given Pageable
will override any previously specified sort
if
the Sort
object is not Sort.isUnsorted()
.Stream<T> stream()
Stream
wrapping cursors that need to be closed.long count()
boolean exists()
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.