Interface JpaRepositoryExecutor
- All Superinterfaces:
AutoCloseable
Jakarta Persistence specific repository tasks executor.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Persistence tasks executor. -
Method Summary
Modifier and TypeMethodDescription<R,
E extends Throwable>
Rcall
(Functions.CheckedFunction<EntityManager, R, E> task) Run persistence session task.default void
close()
static BigDecimal
createBigDecimal
(Number number) BigDecimal
factory method forNumber
.factory()
Persistence session factory.static <T> Optional
<T> optionalFromQuery
(List<T> queryResult) Deprecated.will be removed with Jakarta Persistence 3.2default PersistenceUnitUtil
RetrievePersistenceUnitUtil
from persistence session factory.<E extends Throwable>
voidrun
(Functions.CheckedConsumer<EntityManager, E> task) Run persistence session task.
-
Method Details
-
createBigDecimal
BigDecimal
factory method forNumber
.- Parameters:
number
- source number- Returns:
- the
BigDecimal
instance
-
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:
close
in interfaceAutoCloseable
-
factory
EntityManagerFactory factory()Persistence session factory.- Returns:
- the session factory instance
-
persistenceUnitUtil
RetrievePersistenceUnitUtil
from persistence session factory.- Returns:
- the
PersistenceUnitUtil
instance
-
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.DataException
with checkedException
as 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.DataException
with checkedException
as a cause if unable to compute a result
-