JpaSupportService

Provides access to the current interaction’s EntityManager (s)

API

JpaSupportService.java
interface JpaSupportService {
  Try<EntityManager> getEntityManager(Class<?> entityType)     (1)
  EntityManager getEntityManagerElseFail(Class<?> entityType)     (2)
  IllegalStateException failureFor(Class<?> entityType, Throwable cause)
  IllegalStateException failureFor(Class<?> entityType)
  String failureMessage(Class<?> entityType)
}
1 getEntityManager(Class)

Optionally returns the current interaction’s EntityManager , that is bound to given entityClass , based on whether an open interaction is available and a persistence layer is configured in support of JPA.

2 getEntityManagerElseFail(Class)

Returns the current interaction’s EntityManager that is managing the given domain type entityType .

Members

getEntityManager(Class)

Optionally returns the current interaction’s EntityManager , that is bound to given entityClass , based on whether an open interaction is available and a persistence layer is configured in support of JPA.

getEntityManagerElseFail(Class)

Returns the current interaction’s EntityManager that is managing the given domain type entityType .