Interface JpaRepositoryExecutor
- All Superinterfaces:
AutoCloseable
Jakarta Persistence specific repository tasks executor.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePersistence tasks executor. -
Method Summary
Modifier and TypeMethodDescription<R,E extends Throwable>
Rcall(Functions.CheckedFunction<EntityManager, R, E> task) Run persistence session task.default voidclose()static BigDecimalcreateBigDecimal(Number number) BigDecimalfactory method forNumber.factory()Persistence session factory.static <T> Optional<T> optionalFromQuery(List<T> queryResult) Deprecated.will be removed with Jakarta Persistence 3.2default PersistenceUnitUtilRetrievePersistenceUnitUtilfrom persistence session factory.<E extends Throwable>
voidrun(Functions.CheckedConsumer<EntityManager, E> task) Run persistence session task.
-
Method Details
-
createBigDecimal
BigDecimalfactory method forNumber.- Parameters:
number- source number- Returns:
- the
BigDecimalinstance
-
optionalFromQuery
Deprecated.will be removed with Jakarta Persistence 3.2Transform query result asOptional. This is Jakarta Persistence 3.1 workaround. -
close
default void close()- Specified by:
closein interfaceAutoCloseable
-
factory
EntityManagerFactory factory()Persistence session factory.- Returns:
- the session factory instance
-
persistenceUnitUtil
RetrievePersistenceUnitUtilfrom persistence session factory.- Returns:
- the
PersistenceUnitUtilinstance
-
call
Run persistence session task.- Type Parameters:
R- task result typeE- type of (checked) exception that can be thrown- Parameters:
task- task to run- Returns:
- task result
- Throws:
RuntimeException- as is if unable to compute a result, usuallyio.helidon.data.DataExceptionwith checkedExceptionas a cause if unable to compute a result
-
run
Run persistence session task.- Type Parameters:
E- type of (checked) exception that can be thrown- Parameters:
task- task to run- Throws:
RuntimeException- as is if unable to compute a result, usuallyio.helidon.data.DataExceptionwith checkedExceptionas a cause if unable to compute a result
-