Пример #1
0
 private static EntityManagerFactory getEntityManagerFactory(String persistenceUnit) {
   if (persistenceUnit != null) {
     return Stripersist.getEntityManagerFactory(persistenceUnit);
   } else {
     return getEntityManagerFactory();
   }
 }
Пример #2
0
 private static EntityManagerFactory getEntityManagerFactory() {
   if (defaultPersistenceUnit == null) {
     throw new StripesRuntimeException(
         "In order to get EntityManagerFactory without persistenceUnitName you must"
             + " set the value for Stripersitence.defaultPersistenceUnitName");
   }
   return Stripersist.getEntityManagerFactory(defaultPersistenceUnit);
 }
Пример #3
0
 private static EntityManager getEntityManager() {
   if (defaultPersistenceUnit == null) {
     return Stripersist.getEntityManager();
   }
   return Stripersist.getEntityManager(defaultPersistenceUnit);
 }