Interface FluentQuery<T>
- All Known Subinterfaces:
FluentQuery.FetchableFluentQuery<T>
,FluentQuery.ReactiveFluentQuery<T>
public interface FluentQuery<T>
Fluent interface to define and run a query along with projection and sorting and. Instances of
FluentQuery
are immutable.- Since:
- 2.6
- Author:
- Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Fetchable extensionFluentQuery
allowing to materialize results from the underlying query.static interface
Reactive extensionFluentQuery
allowing to materialize results from the underlying query. -
Method Summary
Modifier and TypeMethodDescription<R> FluentQuery<R>
Define the target type the result should be mapped to.default FluentQuery<T>
limit
(int limit) Define the query limit.default FluentQuery<T>
Define which properties or property paths to include in the query.project
(Collection<String> properties) Define which properties or property paths to include in the query.Define the sort order.
-
Method Details
-
sortBy
Define the sort order.- Parameters:
sort
- theSort
specification to sort the results by, may beSort.unsorted()
, must not be null.- Returns:
- a new instance of
FluentQuery
. - Throws:
IllegalArgumentException
- ifsort
isnull
.
-
limit
Define the query limit.- Parameters:
limit
- the limit to apply to the query to limit results. Must not be negative.- Returns:
- a new instance of
FluentQuery
. - Throws:
IllegalArgumentException
- iflimit
is less than zero.UnsupportedOperationException
- if not supported by the underlying implementation.- Since:
- 3.1
-
as
Define the target type the result should be mapped to. Skip this step if you are only interested in the original domain type.- Type Parameters:
R
- result type.- Parameters:
resultType
- must not benull
.- Returns:
- a new instance of
FluentQuery
. - Throws:
IllegalArgumentException
- ifresultType
isnull
.
-
project
Define which properties or property paths to include in the query.- Parameters:
properties
- must not benull
.- Returns:
- a new instance of
FluentQuery
. - Throws:
IllegalArgumentException
- ifproperties
isnull
.
-
project
Define which properties or property paths to include in the query.- Parameters:
properties
- must not benull
.- Returns:
- a new instance of
FluentQuery
. - Throws:
IllegalArgumentException
- ifproperties
isnull
.
-