Class AsyncBaseService<T extends BaseEntity>


  • public class AsyncBaseService<T extends BaseEntity>
    extends BaseService<T>
    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<T> 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<T> 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​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, T... instances)
      The asynchronous version of the BaseService.create(BaseEntity[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.util.List<T> 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<T> instances, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.create(List) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(T 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​(T... instances)
      The asynchronous version of the BaseService.create(BaseEntity[]) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(T 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​(T 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> 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<T> 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<T> 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​(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, T... entities)
      The asynchronous version of the BaseService.delete(BaseEntity[]) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(java.util.List<T> 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<T> 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> deleteAsync​(T instance)
      The asynchronous version of the BaseService.delete(BaseEntity) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(T... entities)
      The asynchronous version of the BaseService.delete(BaseEntity[]) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync​(T 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> getAllAsync​(java.util.function.Consumer<? super java.util.List<T>> 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<T>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> 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<T>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?>... 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<T>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> 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<T>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?>... 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<T>> callback)
      The asynchronous version of the BaseService.getById(long) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> getSingleAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<T> predicate, java.util.function.Consumer<? super java.util.Optional<T>> callback)
      The asynchronous version of the BaseService.getSingle(SqlPredicate) method.
      java.util.concurrent.CompletableFuture<java.lang.Void> hasDuplicatesAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> column, java.util.function.Consumer<? super java.lang.Boolean> callback)
      The asynchronous version of the BaseService.hasDuplicates(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<T,​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<T,​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<T> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​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<T> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​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​(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, T... instances)
      The asynchronous version of the BaseService.update(BaseEntity[]).
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<T> instances)
      The asynchronous version of the BaseService.update(List) without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(java.util.List<T> instances, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(List).
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(T instance)
      The asynchronous version of the BaseService.update(BaseEntity) method without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(T... instances)
      The asynchronous version of the BaseService.update(BaseEntity[]) without custom exception handling.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateAsync​(T instance, java.util.function.Consumer<java.sql.SQLException> exceptionHandling)
      The asynchronous version of the BaseService.update(BaseEntity) method.
      • 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​(T 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​(T 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​(T 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​(T... 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,
                                                                                  T... 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<T> 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<T> 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<T> 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<T> 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)
      • hasDuplicatesAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> hasDuplicatesAsync​(com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> 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)
      • getSingleAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getSingleAsync​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<T> predicate,
                                                                                     java.util.function.Consumer<? super java.util.Optional<T>> callback)
        The asynchronous version of the BaseService.getSingle(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.getSingle(SqlPredicate)
      • getByIdAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> getByIdAsync​(long id,
                                                                                   java.util.function.Consumer<? super java.util.Optional<T>> 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<T>> 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<T>> callback,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> 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<T>> callback,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?>... 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<T>> callback,
                                                                                  OrderTypes sortingType,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?> 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<T>> callback,
                                                                                  OrderTypes sortingType,
                                                                                  com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​?>... 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​(T 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​(T 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​(T... 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,
                                                                                  T... 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<T> 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<T> 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<T,​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<T,​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<T> condition,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​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<T> condition,
                                                                                      com.github.collinalpert.lambda2sql.functions.SqlFunction<T,​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​(T 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​(T 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<T> 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<T> 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​(T... 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,
                                                                                  T... 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<T> 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<T> 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()