public interface EntityManagerHandler
EntityManager handler.
The concrete handler should consistently manage EntityManager lifecycle, including entity manager creation
and closing.
| Modifier and Type | Method and Description |
|---|---|
<R> R |
withEntityManager(EntityManagerOperation<R> operation)
Execute given
operation using an EntityManager instance provided by the Datastore and return
the operation result. |
default void |
withEntityManager(EntityManagerRunnable operation)
Execute given
operation using an EntityManager instance provided by the Datastore. |
<R> R withEntityManager(EntityManagerOperation<R> operation)
operation using an EntityManager instance provided by the Datastore and return
the operation result.
The EntityManager lifecycle is managed by the JPA Datastore, including creation and closing.
R - Operation result typeoperation - The operation to execute (not null)com.holonplatform.core.exceptions.DataAccessException - If an error occurred during EntityManager management or operation executiondefault void withEntityManager(EntityManagerRunnable operation)
operation using an EntityManager instance provided by the Datastore.
The EntityManager lifecycle is managed by the JPA Datastore, including creation and closing.
operation - The operation to execute (not null)com.holonplatform.core.exceptions.DataAccessException - If an error occurred during EntityManager management or operation executionCopyright © 2019 The Holon Platform. All rights reserved.