Interface AsyncQueryable<T>

All Superinterfaces:
Queryable<T>
All Known Implementing Classes:
AsyncEntityProjectionQuery, AsyncEntityQuery, AsyncSingleEntityProjectionQuery, AsyncSingleEntityQuery, AsyncStoredProcedureQuery

public interface AsyncQueryable<T>
extends Queryable<T>
Author:
Collin Alpert
  • Method Details

    • firstAsync

      default CompletableFuture<Optional<T>> firstAsync()
      The asynchronous version of the Queryable.first() method.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.first()
    • firstAsync

      default CompletableFuture<Void> firstAsync​(Consumer<? super Optional<T>> callback)
      The asynchronous version of the Queryable.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:
      Queryable.first()
    • toListAsync

      default CompletableFuture<List<T>> toListAsync()
      The asynchronous version of the Queryable.toList() method.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toList()
    • toListAsync

      default CompletableFuture<Void> toListAsync​(Consumer<? super List<T>> callback)
      The asynchronous version of the Queryable.toList() 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:
      Queryable.toList()
    • toStreamAsync

      default CompletableFuture<Stream<T>> toStreamAsync()
      The asynchronous version of the Queryable.toStream() method.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toStream()
    • toStreamAsync

      default CompletableFuture<Void> toStreamAsync​(Consumer<? super Stream<T>> callback)
      The asynchronous version of the Queryable.toStream() 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:
      Queryable.toStream()
    • toArrayAsync

      default CompletableFuture<T[]> toArrayAsync()
      The asynchronous version of the Queryable.toArray() method.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toArray()
    • toArrayAsync

      default CompletableFuture<Void> toArrayAsync​(Consumer<? super T[]> callback)
      The asynchronous version of the Queryable.toArray() 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:
      Queryable.toArray()
    • toMapAsync

      default <K> CompletableFuture<Map<K,​T>> toMapAsync​(Function<T,​K> keyMapping)
      The asynchronous version of the Queryable.toMap(Function) method.
      Type Parameters:
      K - The type of the keys in the map.
      Parameters:
      keyMapping - The field representing the keys of the map.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toMap(Function)
    • toMapAsync

      default <K> CompletableFuture<Void> toMapAsync​(Function<T,​K> keyMapping, Consumer<? super Map<K,​T>> callback)
      The asynchronous version of the Queryable.toMap(Function) method.
      Type Parameters:
      K - The type of the keys in the map.
      Parameters:
      keyMapping - The field representing the keys of the map.
      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:
      Queryable.toMap(Function)
    • toMapAsync

      default <K,​ V> CompletableFuture<Map<K,​V>> toMapAsync​(Function<T,​K> keyMapping, Function<T,​V> valueMapping)
      The asynchronous version of the Queryable.toMap(Function, Function) method.
      Type Parameters:
      K - The type of the keys in the map.
      V - The type of the values in the map.
      Parameters:
      keyMapping - The field representing the keys of the map.
      valueMapping - The field representing the values of the map.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toMap(Function, Function)
    • toMapAsync

      default <K,​ V> CompletableFuture<Void> toMapAsync​(Function<T,​K> keyMapping, Function<T,​V> valueMapping, Consumer<? super Map<K,​V>> callback)
      The asynchronous version of the Queryable.toMap(Function, Function) method.
      Type Parameters:
      K - The type of the keys in the map.
      V - The type of the values in the map.
      Parameters:
      keyMapping - The field representing the keys of the map.
      valueMapping - The field representing the values of the map.
      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.
    • toSetAsync

      default CompletableFuture<Set<T>> toSetAsync()
      The asynchronous version of the Queryable.toSet() method.
      Returns:
      The asynchronous operation which will retrieve the data from the database. Custom handling for the CompletableFuture can be done here.
      See Also:
      Queryable.toSet()
    • toSetAsync

      default CompletableFuture<Void> toSetAsync​(Consumer<? super Set<T>> callback)
      The asynchronous version of the Queryable.toSet() 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:
      Queryable.toSet()