Class AsyncBaseService<E extends BaseEntity>


  • public class AsyncBaseService<E extends BaseEntity>
    extends BaseService<E>
    This class extends the functionality of a service class by adding support for asynchronous CRUD operations. Inherit from this class instead of the BaseService if you want your services to be able to do stuff asynchronously.
    Author:
    Collin Alpert
    See Also:
    BaseService
    • Method Summary

      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> anyAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<? super java.lang.Boolean> callback)
      The asynchronous version of the BaseService.any(SqlPredicate) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> anyAsync​(java.util.function.Consumer<? super java.lang.Boolean> callback)
      The asynchronous version of the BaseService.any() method.
      java.util.concurrent.CompletableFuture<java.lang.Void> countAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<? super java.lang.Long> callback)
      The asynchronous version of the BaseService.count(SqlPredicate) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> countAsync​(java.util.function.Consumer<? super java.lang.Long> callback)
      The asynchronous version of the BaseService.count() method.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance)
      The asynchronous version of the BaseService.create(BaseEntity) method without custom exception handling and without a callback.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E... instances)
      The asynchronous version of the BaseService.create(BaseEntity[]) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance, java.util.function.Consumer<? super java.lang.Long> callback)
      The asynchronous version of the BaseService.create(BaseEntity) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance, java.util.function.Consumer<? super java.lang.Long> callback, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.create(BaseEntity) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, E... instances)
      The asynchronous version of the BaseService.create(BaseEntity[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.List<E> instances)
      The asynchronous version of the BaseService.create(List) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.List<E> instances, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.create(List) method.
      protected AsyncEntityQuery<E> createAsyncQuery()  
      protected AsyncSingleEntityQuery<E> createAsyncSingleQuery()  
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long id)
      The asynchronous version of the BaseService.delete(long) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long... ids)
      The asynchronous version of the BaseService.delete(long...) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long id, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.delete(long) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
      The asynchronous version of the BaseService.delete(SqlPredicate) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.delete(SqlPredicate) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E instance)
      The asynchronous version of the BaseService.delete(BaseEntity) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E... entities)
      The asynchronous version of the BaseService.delete(BaseEntity[]) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E instance, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.delete(BaseEntity) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, long... ids)
      The asynchronous version of the BaseService.delete(long...) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, E... entities)
      The asynchronous version of the BaseService.delete(BaseEntity[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.List<E> entities)
      The asynchronous version of the BaseService.delete(List) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.List<E> entities, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.delete(List) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback)
      The asynchronous version of the BaseService.getAll() method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> orderBy)
      The asynchronous version of the BaseService.getAll(OrderTypes, SqlFunction) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?>... orderBy)
      The asynchronous version of the BaseService.getAll(OrderTypes, SqlFunction[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> orderBy)
      The asynchronous version of the BaseService.getAll(SqlFunction) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?>... orderBy)
      The asynchronous version of the BaseService.getAll(SqlFunction[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getByIdAsync​(long id, java.util.function.Consumer<? super java.util.Optional<E>> callback)
      The asynchronous version of the BaseService.getById(long) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getFirstAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<? super java.util.Optional<E>> callback)
      The asynchronous version of the BaseService.getFirst(SqlPredicate) method.
      AsyncEntityQuery<E> getMultiple​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
      Retrieves list of entities which match the predicate.
      AsyncSingleEntityQuery<E> getSingle​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
      Retrieves a single entity which matches the predicate.
      java.util.concurrent.CompletableFuture<java.lang.Void> hasDuplicatesAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> column, java.util.function.Consumer<? super java.lang.Boolean> callback)
      The asynchronous version of the BaseService.hasDuplicates(SqlFunction) method.
      <T> java.util.concurrent.CompletableFuture<java.lang.Void> maxAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<? super T> callback)
      The asynchronous version of the BaseService.max(SqlFunction, SqlPredicate) method.
      <T> java.util.concurrent.CompletableFuture<java.lang.Void> maxAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column, java.util.function.Consumer<? super T> callback)
      The asynchronous version of the BaseService.max(SqlFunction) method.
      <T> java.util.concurrent.CompletableFuture<java.lang.Void> minAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, java.util.function.Consumer<? super T> callback)
      The asynchronous version of the BaseService.min(SqlFunction, SqlPredicate) method.
      <T> java.util.concurrent.CompletableFuture<java.lang.Void> minAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column, java.util.function.Consumer<? super T> callback)
      The asynchronous version of the BaseService.min(SqlFunction) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> truncateTableAsync()
      The asynchronous version of the BaseService.truncateTable() method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> truncateTableAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.truncateTable() method.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> newValueFunction)
      The asynchronous version of the BaseService.update(long, SqlFunction, SqlFunction) method without custom exception handling.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> newValueFunction, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(long, SqlFunction, SqlFunction) method.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, R newValue)
      The asynchronous version of the BaseService.update(long, SqlFunction, Object) method without custom exception handling.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, R newValue, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(long, SqlFunction, Object) method.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, R newValue)
      The asynchronous version of the BaseService.update(SqlPredicate, SqlFunction, Object) method without custom exception handling.
      <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column, R newValue, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(SqlPredicate, SqlFunction, Object) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E instance)
      The asynchronous version of the BaseService.update(BaseEntity) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E... instances)
      The asynchronous version of the BaseService.update(BaseEntity[]) without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E instance, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(BaseEntity) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, E... instances)
      The asynchronous version of the BaseService.update(BaseEntity[]).
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<E> instances)
      The asynchronous version of the BaseService.update(List) without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<E> instances, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(List).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AsyncBaseService

        public AsyncBaseService()
    • Method Detail

      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance)
        The asynchronous version of the BaseService.create(BaseEntity) method without custom exception handling and without a callback.
        Parameters:
        instance - The instance to create on the database asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(BaseEntity)
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance,
                                                                                  java.util.function.Consumer<? super java.lang.Long> callback)
        The asynchronous version of the BaseService.create(BaseEntity) method without custom exception handling.
        Parameters:
        instance - The instance to create on the database asynchronously.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(BaseEntity)
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E instance,
                                                                                  java.util.function.Consumer<? super java.lang.Long> callback,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.create(BaseEntity) method.
        Parameters:
        instance - The instance to create on the database asynchronously.
        callback - The action to apply to the result, once it is computed.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(BaseEntity)
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(E... instances)
        The asynchronous version of the BaseService.create(BaseEntity[]) method without custom exception handling.
        Parameters:
        instances - The instance to create on the database asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(BaseEntity[])
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling,
                                                                                  E... instances)
        The asynchronous version of the BaseService.create(BaseEntity[]) method.
        Parameters:
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        instances - The instance to create on the database asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(BaseEntity[])
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.List<E> instances)
        The asynchronous version of the BaseService.create(List) method without custom exception handling.
        Parameters:
        instances - The instance to create on the database asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(List)
      • createAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.List<E> instances,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.create(List) method.
        Parameters:
        instances - The instance to create on the database asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.create(List)
      • countAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> countAsync​(java.util.function.Consumer<? super java.lang.Long> callback)
        The asynchronous version of the BaseService.count() method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.count()
      • countAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> countAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                                 java.util.function.Consumer<? super java.lang.Long> callback)
        The asynchronous version of the BaseService.count(SqlPredicate) method.
        Parameters:
        predicate - The condition to count by.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.count(SqlPredicate)
      • anyAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> anyAsync​(java.util.function.Consumer<? super java.lang.Boolean> callback)
        The asynchronous version of the BaseService.any() method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.any()
      • anyAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> anyAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                               java.util.function.Consumer<? super java.lang.Boolean> callback)
        The asynchronous version of the BaseService.any(SqlPredicate) method.
        Parameters:
        predicate - The condition to check for.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.any(SqlPredicate)
      • maxAsync

        public <T> java.util.concurrent.CompletableFuture<java.lang.Void> maxAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column,
                                                                                   java.util.function.Consumer<? super T> callback)
        The asynchronous version of the BaseService.max(SqlFunction) method.
        Type Parameters:
        T - The generic type of the column. It is also the return type.
        Parameters:
        column - The column to get the maximum value of.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.max(SqlFunction)
      • maxAsync

        public <T> java.util.concurrent.CompletableFuture<java.lang.Void> maxAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column,
                                                                                   com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                                   java.util.function.Consumer<? super T> callback)
        The asynchronous version of the BaseService.max(SqlFunction, SqlPredicate) method.
        Type Parameters:
        T - The generic type of the column. It is also the return type.
        Parameters:
        column - The column to get the maximum value of.
        predicate - The predicate to filter by.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.max(SqlFunction, SqlPredicate)
      • minAsync

        public <T> java.util.concurrent.CompletableFuture<java.lang.Void> minAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column,
                                                                                   java.util.function.Consumer<? super T> callback)
        The asynchronous version of the BaseService.min(SqlFunction) method.
        Type Parameters:
        T - The generic type of the column. It is also the return type.
        Parameters:
        column - The column to get the minimum value of.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.min(SqlFunction)
      • minAsync

        public <T> java.util.concurrent.CompletableFuture<java.lang.Void> minAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​T> column,
                                                                                   com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                                   java.util.function.Consumer<? super T> callback)
        The asynchronous version of the BaseService.min(SqlFunction, SqlPredicate) method.
        Type Parameters:
        T - The generic type of the column. It is also the return type.
        Parameters:
        column - The column to get the minimum value of.
        predicate - The predicate to filter by.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.min(SqlFunction, SqlPredicate)
      • hasDuplicatesAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> hasDuplicatesAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> column,
                                                                                         java.util.function.Consumer<? super java.lang.Boolean> callback)
        The asynchronous version of the BaseService.hasDuplicates(SqlFunction) method.
        Parameters:
        column - The column to check for duplicates in.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.hasDuplicates(SqlFunction)
      • getFirstAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getFirstAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                                    java.util.function.Consumer<? super java.util.Optional<E>> callback)
        The asynchronous version of the BaseService.getFirst(SqlPredicate) method.
        Parameters:
        predicate - The condition to get the result by.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getFirst(SqlPredicate)
      • getSingle

        public AsyncSingleEntityQuery<E> getSingle​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
        Description copied from class: BaseService
        Retrieves a single entity which matches the predicate.
        Overrides:
        getSingle in class BaseService<E extends BaseEntity>
        Parameters:
        predicate - The SqlPredicate to add constraints to a DQL query.
        Returns:
        An entity matching the result of the query.
      • getMultiple

        public AsyncEntityQuery<E> getMultiple​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
        Retrieves list of entities which match the predicate.
        Overrides:
        getMultiple in class BaseService<E extends BaseEntity>
        Parameters:
        predicate - The SqlPredicate to add constraints to a DQL statement.
        Returns:
        A list of entities matching the result of the query.
      • getByIdAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getByIdAsync​(long id,
                                                                                   java.util.function.Consumer<? super java.util.Optional<E>> callback)
        The asynchronous version of the BaseService.getById(long) method.
        Parameters:
        id - An id to find a specific entity by.
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getById(long)
      • getAllAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback)
        The asynchronous version of the BaseService.getAll() method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getAll()
      • getAllAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> orderBy)
        The asynchronous version of the BaseService.getAll(SqlFunction) method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        orderBy - The property to order by.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getAll(SqlFunction)
      • getAllAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?>... orderBy)
        The asynchronous version of the BaseService.getAll(SqlFunction[]) method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        orderBy - The properties to order by.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getAll(SqlFunction[])
      • getAllAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback,
                                                                                  OrderTypes sortingType,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?> orderBy)
        The asynchronous version of the BaseService.getAll(OrderTypes, SqlFunction) method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        orderBy - The property to order by.
        sortingType - The order direction. Can be either ascending or descending.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getAll(OrderTypes, SqlFunction)
      • getAllAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getAllAsync​(java.util.function.Consumer<? super java.util.List<E>> callback,
                                                                                  OrderTypes sortingType,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​?>... orderBy)
        The asynchronous version of the BaseService.getAll(OrderTypes, SqlFunction[]) method.
        Parameters:
        callback - The action to apply to the result, once it is computed.
        orderBy - The properties to order by.
        sortingType - The order direction. Can be either ascending or descending.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.getAll(OrderTypes, SqlFunction[])
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E instance)
        The asynchronous version of the BaseService.update(BaseEntity) method without custom exception handling.
        Parameters:
        instance - The instance to update asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(BaseEntity)
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E instance,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.update(BaseEntity) method.
        Parameters:
        instance - The instance to update asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(BaseEntity)
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(E... instances)
        The asynchronous version of the BaseService.update(BaseEntity[]) without custom exception handling.
        Parameters:
        instances - The instances to update asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(BaseEntity[])
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling,
                                                                                  E... instances)
        The asynchronous version of the BaseService.update(BaseEntity[]).
        Parameters:
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        instances - The instances to update asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(BaseEntity[])
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<E> instances)
        The asynchronous version of the BaseService.update(List) without custom exception handling.
        Parameters:
        instances - The instances to update asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(List)
      • updateAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<E> instances,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.update(List).
        Parameters:
        instances - The instances to update asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(List)
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> newValueFunction)
        The asynchronous version of the BaseService.update(long, SqlFunction, SqlFunction) method without custom exception handling.
        Type Parameters:
        R - The type of the column to update.
        Parameters:
        entityId - The id of the row to update.
        column - The column to update.
        newValueFunction - The function to calculate the new value.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> newValueFunction,
                                                                                      java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.update(long, SqlFunction, SqlFunction) method.
        Type Parameters:
        R - The type of the column to update.
        Parameters:
        entityId - The id of the row to update.
        column - The column to update.
        newValueFunction - The function to calculate the new value.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      R newValue)
        The asynchronous version of the BaseService.update(long, SqlFunction, Object) method without custom exception handling.
        Type Parameters:
        R - The data type of the column to update. It must be the same as the data type of the new value.
        Parameters:
        entityId - The id of the instance to update asynchronously.
        column - The column of the entity to update.
        newValue - The new value of the column.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(long, SqlFunction, Object)
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(long entityId,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      R newValue,
                                                                                      java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.update(long, SqlFunction, Object) method.
        Type Parameters:
        R - The data type of the column to update. It must be the same as the data type of the new value.
        Parameters:
        entityId - The id of the instance to update asynchronously.
        column - The column of the entity to update.
        newValue - The new value of the column.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(long, SqlFunction, Object)
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      R newValue)
        The asynchronous version of the BaseService.update(SqlPredicate, SqlFunction, Object) method without custom exception handling.
        Type Parameters:
        R - The data type of the column to update. It must be the same as the data type of the new value.
        Parameters:
        condition - The condition to find records by which will be updated asynchronously.
        column - The column of the entity to update.
        newValue - The new value of the column.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(SqlPredicate, SqlFunction, Object)
      • updateAsync

        public <R> java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> column,
                                                                                      R newValue,
                                                                                      java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.update(SqlPredicate, SqlFunction, Object) method.
        Type Parameters:
        R - The data type of the column to update. It must be the same as the data type of the new value.
        Parameters:
        condition - The condition to find records by which will be updated asynchronously.
        column - The column of the entity to update.
        newValue - The new value of the column.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.update(SqlPredicate, SqlFunction, Object)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E instance)
        The asynchronous version of the BaseService.delete(BaseEntity) method without custom exception handling.
        Parameters:
        instance - The instance to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(BaseEntity)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E instance,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.delete(BaseEntity) method.
        Parameters:
        instance - The instance to delete asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(BaseEntity)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long id)
        The asynchronous version of the BaseService.delete(long) method without custom exception handling.
        Parameters:
        id - The id of the instance to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(long)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long id,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.delete(long) method.
        Parameters:
        id - The id of the instance to delete asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(long)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.List<E> entities)
        The asynchronous version of the BaseService.delete(List) method without custom exception handling.
        Parameters:
        entities - The instances to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(List)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.List<E> entities,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.delete(List) method.
        Parameters:
        entities - The instances to delete asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(List)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(E... entities)
        The asynchronous version of the BaseService.delete(BaseEntity[]) method without custom exception handling.
        Parameters:
        entities - The instances to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(BaseEntity[])
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling,
                                                                                  E... entities)
        The asynchronous version of the BaseService.delete(BaseEntity[]) method.
        Parameters:
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        entities - The instances to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(BaseEntity[])
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(long... ids)
        The asynchronous version of the BaseService.delete(long...) method without custom exception handling.
        Parameters:
        ids - The ids of the instances to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(long...)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling,
                                                                                  long... ids)
        The asynchronous version of the BaseService.delete(long...) method.
        Parameters:
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        ids - The ids of the instances to delete asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(long...)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
        The asynchronous version of the BaseService.delete(SqlPredicate) method without custom exception handling.
        Parameters:
        predicate - A condition to delete records on the database by asynchronously.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(SqlPredicate)
      • deleteAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate,
                                                                                  java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.delete(SqlPredicate) method.
        Parameters:
        predicate - A condition to delete records on the database by asynchronously.
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.delete(SqlPredicate)
      • truncateTableAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> truncateTableAsync()
        The asynchronous version of the BaseService.truncateTable() method without custom exception handling.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.truncateTable()
      • truncateTableAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> truncateTableAsync​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
        The asynchronous version of the BaseService.truncateTable() method.
        Parameters:
        exceptionHandling - Custom exception handling for the checked exception thrown by the underlying method.
        Returns:
        A CompletableFuture which represents the asynchronous operation.
        See Also:
        BaseService.truncateTable()