Interface ExecutableSelectOperation.TerminatingResults<T>
- All Known Subinterfaces:
ExecutableSelectOperation.ExecutableSelect<T>, ExecutableSelectOperation.SelectWithProjection<T>, ExecutableSelectOperation.SelectWithQuery<T>, ExecutableSelectOperation.SelectWithTable<T>, ExecutableSelectOperation.TerminatingSelect<T>
- Enclosing interface:
ExecutableSelectOperation
public static interface ExecutableSelectOperation.TerminatingResults<T>
Trigger
SELECT query execution by calling one of the terminating methods and return mapped results.- Since:
- 2.1
- Author:
- Mark Paluch, John Blum
-
Method Summary
Modifier and TypeMethodDescriptionall()Get all matching elements.first()Get the first result, or no result.@Nullable TGet the first result, or no result.map(QueryResultConverter<? super T, ? extends R> converter) Map the query result to a different type usingQueryResultConverter.one()Get exactly zero or one result.@Nullable ToneValue()Get exactly zero or one result.slice()Execute the query with paging and convert the result set to aSliceof entities.stream()Stream all matching elements.
-
Method Details
-
map
@Contract("_ -> new") <R> ExecutableSelectOperation.TerminatingResults<R> map(QueryResultConverter<? super T, ? extends R> converter) Map the query result to a different type usingQueryResultConverter.- Type Parameters:
R-typeof the result.- Parameters:
converter- the converter, must not be null.- Returns:
- new instance of
ExecutableSelectOperation.TerminatingResults. - Throws:
IllegalArgumentException- ifconverteris null.- Since:
- 5.0
-
first
Get the first result, or no result.- Returns:
- the first result or
Optional.empty()if no match found. - See Also:
-
firstValue
@Nullable T firstValue()Get the first result, or no result.- Returns:
- the first result or null if no match found.
-
one
Get exactly zero or one result.- Returns:
- a single result or
Optional.empty()if no match found. - Throws:
IncorrectResultSizeDataAccessException- if more than one match found.- See Also:
-
oneValue
@Nullable T oneValue()Get exactly zero or one result.- Returns:
- the single result or null if no match found.
- Throws:
IncorrectResultSizeDataAccessException- if more than one match found.
-
all
-
slice
-
stream
-