public class MyEMFDatabase extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
INIT_EM |
static String |
MAIN_EM |
static String |
REALM_EM |
| Constructor and Description |
|---|
MyEMFDatabase() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeEntityManager(Object ownership,
String emKey) |
static Object |
createEntityManager(String emKey)
get the hibernate session and set it on the thread local.
|
static javax.persistence.EntityManager |
getEntityManager(String emKey) |
static javax.persistence.EntityManagerFactory |
getEntityManagerFactory() |
static void |
openEntityManagerFactory(String persistenceUnit) |
public static final String MAIN_EM
public static final String INIT_EM
public static final String REALM_EM
public static void openEntityManagerFactory(String persistenceUnit) throws Exception
Exceptionpublic static javax.persistence.EntityManagerFactory getEntityManagerFactory()
throws Exception
Exceptionpublic static Object createEntityManager(String emKey) throws Exception
Exceptionpublic static javax.persistence.EntityManager getEntityManager(String emKey) throws Exception
ExceptionCopyright © 2016. All rights reserved.