Class AsyncBaseService<E extends BaseEntity>
java.lang.Object
com.github.collinalpert.java2db.services.BaseService<E>
com.github.collinalpert.java2db.services.AsyncBaseService<E>
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
-
Field Summary
Fields inherited from class com.github.collinalpert.java2db.services.BaseService
connectionConfiguration, tableName, type -
Constructor Summary
Constructors Modifier Constructor Description protectedAsyncBaseService(ConnectionConfiguration connectionConfiguration) -
Method Summary
Modifier and Type Method Description CompletableFuture<Void>anyAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super Boolean> callback)The asynchronous version of theBaseService.any(SqlPredicate)method.CompletableFuture<Void>anyAsync(Consumer<? super Boolean> callback)The asynchronous version of theBaseService.any()method.CompletableFuture<Void>countAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super Integer> callback)The asynchronous version of theBaseService.count(SqlPredicate)method.CompletableFuture<Void>countAsync(Consumer<? super Integer> callback)The asynchronous version of theBaseService.count()method.CompletableFuture<Void>createAsync(E instance)The asynchronous version of theBaseService.create(BaseEntity)method without custom exception handling and without a callback.CompletableFuture<Void>createAsync(E... instances)The asynchronous version of theBaseService.create(BaseEntity[])method without custom exception handling.CompletableFuture<Void>createAsync(E instance, Consumer<? super Integer> callback)The asynchronous version of theBaseService.create(BaseEntity)method without custom exception handling.CompletableFuture<Void>createAsync(E instance, Consumer<? super Integer> callback, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.create(BaseEntity)method.CompletableFuture<Void>createAsync(Consumer<SQLException> exceptionHandling, E... instances)The asynchronous version of theBaseService.create(BaseEntity[])method.CompletableFuture<Void>createAsync(List<E> instances)The asynchronous version of theBaseService.create(List)method without custom exception handling.CompletableFuture<Void>createAsync(List<E> instances, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.create(List)method.protected AsyncEntityQuery<E>createAsyncQuery()protected AsyncSingleEntityQuery<E>createAsyncSingleQuery()CompletableFuture<Void>deleteAsync(int id)The asynchronous version of theBaseService.delete(int)method without custom exception handling.CompletableFuture<Void>deleteAsync(int... ids)The asynchronous version of theBaseService.delete(int...)method without custom exception handling.CompletableFuture<Void>deleteAsync(int id, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.delete(int)method.CompletableFuture<Void>deleteAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)The asynchronous version of theBaseService.delete(SqlPredicate)method without custom exception handling.CompletableFuture<Void>deleteAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.delete(SqlPredicate)method.CompletableFuture<Void>deleteAsync(E instance)The asynchronous version of theBaseService.delete(BaseEntity)method without custom exception handling.CompletableFuture<Void>deleteAsync(E... entities)The asynchronous version of theBaseService.delete(BaseEntity[])method without custom exception handling.CompletableFuture<Void>deleteAsync(E instance, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.delete(BaseEntity)method.CompletableFuture<Void>deleteAsync(Consumer<SQLException> exceptionHandling, int... ids)The asynchronous version of theBaseService.delete(int...)method.CompletableFuture<Void>deleteAsync(Consumer<SQLException> exceptionHandling, E... entities)The asynchronous version of theBaseService.delete(BaseEntity[])method.CompletableFuture<Void>deleteAsync(List<E> entities)The asynchronous version of theBaseService.delete(List)method without custom exception handling.CompletableFuture<Void>deleteAsync(List<E> entities, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.delete(List)method.CompletableFuture<Void>getAllAsync(Consumer<? super List<E>> callback)The asynchronous version of theBaseService.getAll()method.CompletableFuture<Void>getAllAsync(Consumer<? super List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> orderBy)The asynchronous version of theBaseService.getAll(SqlFunction, OrderTypes)method.CompletableFuture<Void>getAllAsync(Consumer<? super List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?>... orderBy)The asynchronous version of theBaseService.getAll(SqlFunction[], OrderTypes)method.CompletableFuture<Void>getAllAsync(Consumer<? super List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> orderBy)The asynchronous version of theBaseService.getAll(SqlFunction)method.CompletableFuture<Void>getAllAsync(Consumer<? super List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?>... orderBy)The asynchronous version of theBaseService.getAll(SqlFunction[])method.CompletableFuture<Void>getByIdAsync(int id, Consumer<? super Optional<E>> callback)The asynchronous version of theBaseService.getById(int)method.CompletableFuture<Void>getFirstAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super Optional<E>> callback)The asynchronous version of theBaseService.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.CompletableFuture<Void>hasDuplicatesAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> column, Consumer<? super Boolean> callback)The asynchronous version of theBaseService.hasDuplicates(SqlFunction)method.<T> CompletableFuture<Void>maxAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super T> callback)The asynchronous version of theBaseService.max(SqlFunction, SqlPredicate)method.<T> CompletableFuture<Void>maxAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, Consumer<? super T> callback)The asynchronous version of theBaseService.max(SqlFunction)method.<T> CompletableFuture<Void>minAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super T> callback)The asynchronous version of theBaseService.min(SqlFunction, SqlPredicate)method.<T> CompletableFuture<Void>minAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, Consumer<? super T> callback)The asynchronous version of theBaseService.min(SqlFunction)method.CompletableFuture<Void>truncateTableAsync()The asynchronous version of theBaseService.truncateTable()method without custom exception handling.CompletableFuture<Void>truncateTableAsync(Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.truncateTable()method.<R> CompletableFuture<Void>updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> newValueFunction)The asynchronous version of theBaseService.update(int, SqlFunction, SqlFunction)method without custom exception handling.<R> CompletableFuture<Void>updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> newValueFunction, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(int, SqlFunction, SqlFunction)method.<R> CompletableFuture<Void>updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue)The asynchronous version of theBaseService.update(int, SqlFunction, Object)method without custom exception handling.<R> CompletableFuture<Void>updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(int, SqlFunction, Object)method.<R> CompletableFuture<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 theBaseService.update(SqlPredicate, SqlFunction, Object)method without custom exception handling.<R> CompletableFuture<Void>updateAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(SqlPredicate, SqlFunction, Object)method.CompletableFuture<Void>updateAsync(E instance)The asynchronous version of theBaseService.update(BaseEntity)method without custom exception handling.CompletableFuture<Void>updateAsync(E... instances)The asynchronous version of theBaseService.update(BaseEntity[])without custom exception handling.CompletableFuture<Void>updateAsync(E instance, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(BaseEntity)method.CompletableFuture<Void>updateAsync(Consumer<SQLException> exceptionHandling, E... instances)The asynchronous version of theBaseService.update(BaseEntity[]).CompletableFuture<Void>updateAsync(List<E> instances)The asynchronous version of theBaseService.update(List)without custom exception handling.CompletableFuture<Void>updateAsync(List<E> instances, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(List).Methods inherited from class com.github.collinalpert.java2db.services.BaseService
any, any, count, count, create, create, create, createPagination, createPagination, createPagination, createPagination, createQuery, createSingleQuery, delete, delete, delete, delete, delete, delete, getAll, getAll, getAll, getAll, getAll, getById, getFirst, hasDuplicates, max, max, min, min, truncateTable, update, update, update, update, update, update
-
Constructor Details
-
Method Details
-
createAsync
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
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 CompletableFuture<Void> createAsync(E instance, Consumer<? super Integer> callback, Consumer<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
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 CompletableFuture<Void> createAsync(Consumer<SQLException> exceptionHandling, E... 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
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 CompletableFuture<Void> createAsync(List<E> instances, Consumer<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
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 CompletableFuture<Void> countAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super Integer> 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
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 CompletableFuture<Void> anyAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super 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)
-
maxAsync
public <T> CompletableFuture<Void> maxAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, Consumer<? super T> callback)The asynchronous version of theBaseService.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
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.max(SqlFunction)
-
maxAsync
public <T> CompletableFuture<Void> maxAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super T> callback)The asynchronous version of theBaseService.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
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.max(SqlFunction, SqlPredicate)
-
minAsync
public <T> CompletableFuture<Void> minAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, Consumer<? super T> callback)The asynchronous version of theBaseService.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
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.min(SqlFunction)
-
minAsync
public <T> CompletableFuture<Void> minAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,T> column, com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super T> callback)The asynchronous version of theBaseService.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
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.min(SqlFunction, SqlPredicate)
-
hasDuplicatesAsync
public CompletableFuture<Void> hasDuplicatesAsync(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> column, Consumer<? super 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)
-
createAsyncQuery
-
createAsyncSingleQuery
-
getFirstAsync
public CompletableFuture<Void> getFirstAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<? super Optional<E>> callback)The asynchronous version of theBaseService.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
CompletableFuturewhich 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:BaseServiceRetrieves a single entity which matches the predicate.- Overrides:
getSinglein classBaseService<E extends BaseEntity>- Parameters:
predicate- TheSqlPredicateto 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:
getMultiplein classBaseService<E extends BaseEntity>- Parameters:
predicate- TheSqlPredicateto add constraints to a DQL statement.- Returns:
- A list of entities matching the result of the query.
-
getByIdAsync
The asynchronous version of theBaseService.getById(int)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(int)
-
getAllAsync
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 CompletableFuture<Void> getAllAsync(Consumer<? super List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> 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 CompletableFuture<Void> getAllAsync(Consumer<? super List<E>> callback, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?>... 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 CompletableFuture<Void> getAllAsync(Consumer<? super List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?> orderBy)The asynchronous version of theBaseService.getAll(SqlFunction, OrderTypes)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(SqlFunction, OrderTypes)
-
getAllAsync
public CompletableFuture<Void> getAllAsync(Consumer<? super List<E>> callback, OrderTypes sortingType, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,?>... orderBy)The asynchronous version of theBaseService.getAll(SqlFunction[], OrderTypes)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(SqlFunction[], OrderTypes)
-
updateAsync
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
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
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 CompletableFuture<Void> updateAsync(Consumer<SQLException> exceptionHandling, E... 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
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 CompletableFuture<Void> updateAsync(List<E> instances, Consumer<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> CompletableFuture<Void> updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> newValueFunction)The asynchronous version of theBaseService.update(int, 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
CompletableFuturewhich represents the asynchronous operation.
-
updateAsync
public <R> CompletableFuture<Void> updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> newValueFunction, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(int, 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
CompletableFuturewhich represents the asynchronous operation.
-
updateAsync
public <R> CompletableFuture<Void> updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue)The asynchronous version of theBaseService.update(int, 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(int, SqlFunction, Object)
-
updateAsync
public <R> CompletableFuture<Void> updateAsync(int entityId, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue, Consumer<SQLException> exceptionHandling)The asynchronous version of theBaseService.update(int, 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(int, SqlFunction, Object)
-
updateAsync
public <R> CompletableFuture<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 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> CompletableFuture<Void> updateAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> condition, com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> column, R newValue, Consumer<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
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
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
The asynchronous version of theBaseService.delete(int)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(int)
-
deleteAsync
The asynchronous version of theBaseService.delete(int)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(int)
-
deleteAsync
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 CompletableFuture<Void> deleteAsync(List<E> entities, Consumer<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
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 CompletableFuture<Void> deleteAsync(Consumer<SQLException> exceptionHandling, E... 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
The asynchronous version of theBaseService.delete(int...)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(int...)
-
deleteAsync
The asynchronous version of theBaseService.delete(int...)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(int...)
-
deleteAsync
public CompletableFuture<Void> deleteAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> 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 CompletableFuture<Void> deleteAsync(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate, Consumer<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
The asynchronous version of theBaseService.truncateTable()method without custom exception handling.- Returns:
- A
CompletableFuturewhich represents the asynchronous operation. - See Also:
BaseService.truncateTable()
-
truncateTableAsync
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()
-