- Type Parameters:
S
- type of the persistence session, e.g.EntityManager
- Enclosing class:
Data
This interface provides access to persistence provider session. Life cycle of the session is managed by the Helidon Data framework.
Implementing this interface makes repository class to depend on specific persistence session type. Target persistence session type must match session type of the specific persistence provider, e.g.
EntityManager
for Jakarta PersistenceClientSession
for native EclipseLink
-
Method Summary
-
Method Details
-
run
Execute task with persistence session.Persistence session life cycle is managed by the Helidon Data framework and this session is available only while this method is running. Supplied
Consumer
shall not pass provided persistence session instance outside this method scope. SuppliedConsumer
shall not close provided persistence session.- Parameters:
task
- task to be executed, shall not benull
- Throws:
RuntimeException
- when task execution failed, checked exceptions are not allowed and must be all handled by the suppliedConsumer
-
call
Execute task with persistence session.Persistence session life cycle is managed by the Helidon Data framework and this session is available only while this method is running. Supplied
Function
shall not pass provided persistence session instance outside this method scope. SuppliedFunction
shall not close provided persistence session.- Type Parameters:
R
- task result type- Parameters:
task
- task to be executed, shall not benull
- Returns:
- task result
- Throws:
RuntimeException
- when task execution failed, checked exceptions are not allowed and must be all handled by the suppliedFunction
-