T
- public interface QueryByExampleExecutor<T>
Example
instances.Modifier and Type | Method and Description |
---|---|
<S extends T> |
count(Example<S> example)
Returns the number of instances matching the given
Example . |
<S extends T> |
exists(Example<S> example)
Checks whether the data store contains elements that match the given
Example . |
<S extends T> |
findAll(Example<S> example)
Returns all entities matching the given
Example . |
<S extends T> |
findAll(Example<S> example,
Pageable pageable)
|
<S extends T> |
findAll(Example<S> example,
Sort sort)
|
<S extends T,R> |
findBy(Example<S> example,
Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
Returns entities matching the given
Example applying the queryFunction that defines the
query and its result type. |
<S extends T> |
findOne(Example<S> example)
Returns a single entity matching the given
Example or Optional.empty() if none was found. |
<S extends T> Optional<S> findOne(Example<S> example)
Example
or Optional.empty()
if none was found.example
- must not be null.Example
or Optional.empty()
if none was found.IncorrectResultSizeDataAccessException
- if the Example yields more than one result.<S extends T> Iterable<S> findAll(Example<S> example)
Example
. In case no match could be found an empty Iterable
is returned.example
- must not be null.Example
.<S extends T> Iterable<S> findAll(Example<S> example, Sort sort)
Example
applying the given Sort
. In case no match could be
found an empty Iterable
is returned.example
- must not be null.sort
- the Sort
specification to sort the results by, may be Sort.unsorted()
, must not be
null.Example
.<S extends T> Page<S> findAll(Example<S> example, Pageable pageable)
Page
of entities matching the given Example
. In case no match could be found, an empty
Page
is returned.example
- must not be null.pageable
- the pageable to request a paged result, can be Pageable.unpaged()
, must not be
null.Page
of entities matching the given Example
.<S extends T> long count(Example<S> example)
Example
.<S extends T> boolean exists(Example<S> example)
Example
.<S extends T,R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
Example
applying the queryFunction
that defines the
query and its result type.example
- must not be null.queryFunction
- the query function defining projection, sorting, and the result typeExample
.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.