Interface AsyncSingleQueryable<T>
-
- All Superinterfaces:
SingleQueryable<T>
- All Known Subinterfaces:
AsyncQueryable<T>
- All Known Implementing Classes:
AsyncEntityProjectionQuery,AsyncEntityQuery,AsyncSingleEntityProjectionQuery,AsyncSingleEntityQuery
public interface AsyncSingleQueryable<T> extends SingleQueryable<T>
- Author:
- Collin Alpert
-
-
Method Summary
Modifier and Type Method Description default java.util.concurrent.CompletableFuture<java.util.Optional<T>>firstAsync()The asynchronous version of theSingleQueryable.first()method.default java.util.concurrent.CompletableFuture<java.lang.Void>firstAsync(java.util.function.Consumer<? super java.util.Optional<T>> callback)The asynchronous version of theSingleQueryable.first()method.-
Methods inherited from interface com.github.collinalpert.java2db.queries.SingleQueryable
first, getQuery
-
-
-
-
Method Detail
-
firstAsync
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> 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
default java.util.concurrent.CompletableFuture<java.lang.Void> firstAsync(java.util.function.Consumer<? super java.util.Optional<T>> callback)
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()
-
-