/** Initialise JPA entity manager factories. */
 public JPAApi start() {
   for (JPAConfig.PersistenceUnit persistenceUnit : jpaConfig.persistenceUnits()) {
     emfs.put(
         persistenceUnit.name, Persistence.createEntityManagerFactory(persistenceUnit.unitName));
   }
   return this;
 }
Exemple #2
0
 @Transient
 public JPAContext getJPAContext() {
   if (_jpaConfig == null) {
     _jpaConfig = getJPAConfig(getClass());
   }
   return _jpaConfig.getJPAContext();
 }
Exemple #3
0
 protected JPAContext getJPAContext() {
   if (_jpaConfig == null) {
     _jpaConfig = JPA.getJPAConfig(jpaConfigName);
   }
   return _jpaConfig.getJPAContext();
 }