Interface AsyncSingleQueryable<T>
- All Superinterfaces:
SingleQueryable<T>
- All Known Subinterfaces:
AsyncQueryable<T>
- All Known Implementing Classes:
AsyncEntityProjectionQuery,AsyncEntityQuery,AsyncSingleEntityProjectionQuery,AsyncSingleEntityQuery,AsyncStoredProcedureQuery
public interface AsyncSingleQueryable<T> extends SingleQueryable<T>
- Author:
- Collin Alpert
-
Method Summary
Modifier and Type Method Description default CompletableFuture<Optional<T>>firstAsync()The asynchronous version of theSingleQueryable.first()method.default CompletableFuture<Void>firstAsync(Consumer<? super Optional<T>> callback)The asynchronous version of theSingleQueryable.first()method.Methods inherited from interface com.github.collinalpert.java2db.queries.SingleQueryable
first, getQuery
-
Method Details
-
firstAsync
The asynchronous version of theSingleQueryable.first()method.- Returns:
- The asynchronous operation which will retrieve the data from the database.
Custom handling for the
CompletableFuturecan be done here. - See Also:
SingleQueryable.first()
-
firstAsync
The asynchronous version of theSingleQueryable.first()method.- Parameters:
callback- The action to be applied to the result once it is fetched from the database.- Returns:
- The asynchronous operation which will retrieve the data from the database and apply the given action to the result.
- See Also:
SingleQueryable.first()
-