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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFetchable extensionFluentQueryallowing to materialize results from the underlying query.static interfaceReactive extensionFluentQueryallowing 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- theSortspecification to sort the results by, may beSort.unsorted(), must not be null.- Returns:
- a new instance of
FluentQuery. - Throws:
IllegalArgumentException- ifsortisnull.
-
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- iflimitis 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- ifresultTypeisnull.
-
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- ifpropertiesisnull.
-
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- ifpropertiesisnull.
-