Interface JpaRepositoryExecutor.DataRunner
- Enclosing interface:
JpaRepositoryExecutor
public static interface JpaRepositoryExecutor.DataRunner
Persistence tasks executor.
Instances are stored in static
Map so executor context is passed as an argument.-
Method Summary
Modifier and TypeMethodDescription<R,E extends Throwable>
Rcall(JpaRepositoryExecutor executor, Functions.CheckedFunction<EntityManager, R, E> task) Call persistence session task and return result.<E extends Throwable>
voidrun(JpaRepositoryExecutor executor, Functions.CheckedConsumer<EntityManager, E> task) Run persistence session task with no result.
-
Method Details
-
call
<R,E extends Throwable> R call(JpaRepositoryExecutor executor, Functions.CheckedFunction<EntityManager, R, E> task) Call persistence session task and return result.- Type Parameters:
R- task result typeE- type of (checked) exception that can be thrown- Parameters:
executor- executor contexttask- task to call- Returns:
- task result
-
run
<E extends Throwable> void run(JpaRepositoryExecutor executor, Functions.CheckedConsumer<EntityManager, E> task) Run persistence session task with no result.- Type Parameters:
E- type of (checked) exception that can be thrown- Parameters:
executor- executor contexttask- task to run
-