Class AsyncBaseService<T extends BaseEntity>
- java.lang.Object
-
- com.github.collinalpert.java2db.services.BaseService<T>
-
- com.github.collinalpert.java2db.services.AsyncBaseService<T>
-
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 theBaseServiceif you want your services to be able to do stuff asynchronously.- Author:
- Collin Alpert
- See Also:
BaseService
-
-
Field Summary
-
Fields inherited from class com.github.collinalpert.java2db.services.BaseService
mapper, tableName, type
-
-
Constructor Summary
Constructors Constructor Description AsyncBaseService()
-
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 theBaseService.any(SqlPredicate)method.java.util.concurrent.CompletableFuture<java.lang.Void>anyAsync(java.util.function.Consumer<? super java.lang.Boolean> callback)The asynchronous version of theBaseService.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 theBaseService.count(SqlPredicate)method.java.util.concurrent.CompletableFuture<java.lang.Void>countAsync(java.util.function.Consumer<? super java.lang.Long> callback)The asynchronous version of theBaseService.count()method.java.util.concurrent.CompletableFuture<java.lang.Void>createAsync(java.util.function.Consumer<java.sql.SQLException> exceptionHandling, T... instances)The asynchronous version of theBaseService.create(BaseEntity[])method.java.util.concurrent.CompletableFuture<java.lang.Void>createAsync(java.util.List<T> instances)The asynchronous version of theBaseService.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 theBaseService.create(List)method.java.util.concurrent.CompletableFuture<java.lang.Void>createAsync(T instance)The asynchronous version of theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.create(BaseEntity)method.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(long id)The asynchronous version of theBaseService.delete(long)method without custom exception handling.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(long... ids)The asynchronous version of theBaseService.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 theBaseService.delete(long)method.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<T> predicate)The asynchronous version of theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.delete(BaseEntity[])method.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(java.util.List<T> entities)The asynchronous version of theBaseService.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 theBaseService.delete(List)method.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(T instance)The asynchronous version of theBaseService.delete(BaseEntity)method without custom exception handling.java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(T... entities)The asynchronous version of theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.hasDuplicates(SqlFunction)method.java.util.concurrent.CompletableFuture<java.lang.Void>truncateTableAsync()The asynchronous version of theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.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 theBaseService.update(BaseEntity[]).java.util.concurrent.CompletableFuture<java.lang.Void>updateAsync(java.util.List<T> instances)The asynchronous version of theBaseService.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 theBaseService.update(List).java.util.concurrent.CompletableFuture<java.lang.Void>updateAsync(T instance)The asynchronous version of theBaseService.update(BaseEntity)method without custom exception handling.java.util.concurrent.CompletableFuture<java.lang.Void>updateAsync(T... instances)The asynchronous version of theBaseService.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 theBaseService.update(BaseEntity)method.-
Methods inherited from class com.github.collinalpert.java2db.services.BaseService
any, any, count, count, create, create, create, createPagination, createPagination, createPagination, createPagination, createQuery, delete, delete, delete, delete, delete, delete, getAll, getAll, getAll, getAll, getAll, getById, getMultiple, getSingle, hasDuplicates, truncateTable, update, update, update, update, update
-
-
-
-
Method Detail
-
createAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> createAsync(T instance)
The asynchronous version of theBaseService.create(BaseEntity)method without custom exception handling and without a callback.- Parameters:
instance- The instance to create on the database asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.create(BaseEntity[])method without custom exception handling.- Parameters:
instances- The instance to create on the database asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.create(List)method without custom exception handling.- Parameters:
instances- The instance to create on the database asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.count()method.- Parameters:
callback- The action to apply to the result, once it is computed.- Returns:
- A
CompletableFuturewhich 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 theBaseService.count(SqlPredicate)method.- Parameters:
predicate- The condition to count by.callback- The action to apply to the result, once it is computed.- Returns:
- A
CompletableFuturewhich 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 theBaseService.any()method.- Parameters:
callback- The action to apply to the result, once it is computed.- Returns:
- A
CompletableFuturewhich 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 theBaseService.any(SqlPredicate)method.- Parameters:
predicate- The condition to check for.callback- The action to apply to the result, once it is computed.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.getAll()method.- Parameters:
callback- The action to apply to the result, once it is computed.- Returns:
- A
CompletableFuturewhich 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 theBaseService.getAll(SqlFunction)method.- Parameters:
callback- The action to apply to the result, once it is computed.orderBy- The property to order by.- Returns:
- A
CompletableFuturewhich 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 theBaseService.getAll(SqlFunction[])method.- Parameters:
callback- The action to apply to the result, once it is computed.orderBy- The properties to order by.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.update(BaseEntity)method without custom exception handling.- Parameters:
instance- The instance to update asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.update(BaseEntity[])without custom exception handling.- Parameters:
instances- The instances to update asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.update(BaseEntity[]).- Parameters:
exceptionHandling- Custom exception handling for the checked exception thrown by the underlying method.instances- The instances to update asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.update(List)without custom exception handling.- Parameters:
instances- The instances to update asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.update(List).- Parameters:
instances- The instances to update asynchronously.exceptionHandling- Custom exception handling for the checked exception thrown by the underlying method.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(BaseEntity)method without custom exception handling.- Parameters:
instance- The instance to delete asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(long)method without custom exception handling.- Parameters:
id- The id of the instance to delete asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(List)method without custom exception handling.- Parameters:
entities- The instances to delete asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(BaseEntity[])method without custom exception handling.- Parameters:
entities- The instances to delete asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(long...)method without custom exception handling.- Parameters:
ids- The ids of the instances to delete asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich 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 theBaseService.delete(SqlPredicate)method without custom exception handling.- Parameters:
predicate- A condition to delete records on the database by asynchronously.- Returns:
- A
CompletableFuturewhich 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 theBaseService.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
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.delete(SqlPredicate)
-
truncateTableAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> truncateTableAsync()
The asynchronous version of theBaseService.truncateTable()method without custom exception handling.- Returns:
- A
CompletableFuturewhich 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 theBaseService.truncateTable()method.- Parameters:
exceptionHandling- Custom exception handling for the checked exception thrown by the underlying method.- Returns:
- A
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.truncateTable()
-
-