Package com.cmobilecom.af.session
Class PersistenceEntityManagerRegistry
- java.lang.Object
-
- com.cmobilecom.af.session.PersistenceEntityManagerRegistry
-
public class PersistenceEntityManagerRegistry extends java.lang.Object
PersistenceEntityManagerRegistry: register PersistenceEntityManager implementation classes and JPAEntityManagerAccessor instances.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description PersistenceEntityManagerRegistry()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JPAEntityManagerAccessor
getJPAEntityManagerAccessor(boolean jta, boolean errorIfNotFound)
Get the registered JPAEntityManagerAccessor instance.static <T extends PersistenceEntityManager>
Tinstantiate(java.lang.Class<T> persistenceEntityManagerInterface, QueryDescriptor queryDescriptor)
Create a PersistenceEntityManager instance.static void
register(boolean jta, JPAEntityManagerAccessor jpaEntityManagerAccessor)
Register a JPAEntityManagerAccessor instance.static <T extends PersistenceEntityManager>
voidregister(java.lang.Class<T> persistenceEntityManagerInterface, java.lang.Class<? extends T> persistenceEntityManagerImplClass)
Register PersistenceEntityManager implementation.
-
-
-
Method Detail
-
register
public static void register(boolean jta, JPAEntityManagerAccessor jpaEntityManagerAccessor)
Register a JPAEntityManagerAccessor instance.- Parameters:
jta
- whether it is JTA or resource local.jpaEntityManagerAccessor
- JPAEntityManagerAccessor instance- Since:
- 5.17
-
getJPAEntityManagerAccessor
public static JPAEntityManagerAccessor getJPAEntityManagerAccessor(boolean jta, boolean errorIfNotFound)
Get the registered JPAEntityManagerAccessor instance.- Parameters:
jta
- whether it is JTA or resource local.errorIfNotFound
- whether to throw exception if not registered for JTA- Returns:
- JPAEntityManagerAccessor instance
- Throws:
SystemRuntimeException
- throw if it is not registered for JTA and errorIfNotFound is true. For resource local, return default if not registered.- Since:
- 5.17
-
register
public static <T extends PersistenceEntityManager> void register(java.lang.Class<T> persistenceEntityManagerInterface, java.lang.Class<? extends T> persistenceEntityManagerImplClass)
Register PersistenceEntityManager implementation.- Parameters:
persistenceEntityManagerInterface
- interfacepersistenceEntityManagerImplClass
- implementation class
-
instantiate
public static <T extends PersistenceEntityManager> T instantiate(java.lang.Class<T> persistenceEntityManagerInterface, QueryDescriptor queryDescriptor)
Create a PersistenceEntityManager instance.- Parameters:
persistenceEntityManagerInterface
- PersistenceEntityManager type. If null, default to PersistenceEntityManager.queryDescriptor
- query descriptor- Returns:
- persistenceEntityManager instance.
- Throws:
SystemRuntimeException
- throw if the implementation class is not registered- Since:
- 5.14
-
-