Examples of PersistenceUnitDeployment


Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/*     */   }
/*     */
/*     */   private static SessionFactory getSessionFactory(String ref, InjectionContainer container)
/*     */     throws NameNotFoundException
/*     */   {
/* 183 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(ref);
/*     */     ManagedEntityManagerFactory managedFactory;
/* 184 */     if (deployment != null)
/*     */     {
/* 186 */       managedFactory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 190 */       return null;
/*     */     }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/*     */   }
/*     */
/*     */   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
/*     */   {
/*  84 */     String kernelName = in.readUTF();
/*  85 */     PersistenceUnitDeployment deployment = PersistenceUnitRegistry.getPersistenceUnit(kernelName);
/*  86 */     if (deployment == null) throw new IOException("Unable to find persistence unit in registry: " + kernelName);
/*  87 */     this.factory = deployment.getManagedFactory();
/*     */   }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/* 114 */       Ejb3Deployment dep = this.deploymentScope.findRelativeDeployment(relativePath);
/* 115 */       if (dep == null)
/*     */       {
/* 117 */         return null;
/*     */       }
/* 119 */       PersistenceUnitDeployment rtn = dep.getPersistenceUnitDeploymentInternal(name);
/* 120 */       return rtn;
/*     */     }
/* 122 */     PersistenceUnitDeployment rtn = getPersistenceUnitDeploymentInternal(unitName);
/* 123 */     if (rtn != null) return rtn;
/*     */
/* 125 */     for (PersistenceUnitDeployment deployment : PersistenceUnitRegistry.getPersistenceUnits())
/*     */     {
/* 127 */       if (!deployment.isScoped())
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/*     */       {
/* 580 */         String jarName = isScoped ? this.unit.getShortName() : null;
/* 581 */         cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metadata.getName());
/* 582 */         metadata.getProps().setProperty("hibernate.cache.region_prefix", cache_prefix);
/*     */       }
/* 584 */       PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(this.initialContext, this, this.explicitEntityClasses, persistenceUnitMetaData, earShortName, this.unit.getShortName(), isScoped);
/*     */
/* 586 */       PersistenceUnitRegistry.register(deployment);
/* 587 */       this.persistenceUnitDeployments.add(deployment);
/*     */     }
/*     */   }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

            // deployments are segregated
            String jarName = isScoped ? unit.getShortName() : null;
            cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metaData.getName());
            properties.put(SecondLevelCacheUtil.HIBERNATE_CACHE_REGION_PREFIX, cache_prefix);
         }
         PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(initialContext, this, explicitEntityClasses, metaData, earShortName, unit.getShortName(), isScoped);
         PersistenceUnitRegistry.register(deployment);
         persistenceUnitDeployments.add(deployment);
      }
   }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

            // deployments are segregated
            String jarName = isScoped ? unit.getShortName() : null;
            cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metadata.getName());
            metadata.getProps().setProperty(SecondLevelCacheUtil.HIBERNATE_CACHE_REGION_PREFIX, cache_prefix);
         }
         PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(initialContext, this,
               explicitEntityClasses, persistenceUnitMetaData, earShortName, unit.getShortName(), isScoped);
         PersistenceUnitRegistry.register(deployment);
         persistenceUnitDeployments.add(deployment);
      }
   }
View Full Code Here

Examples of org.jboss.jpa.deployment.PersistenceUnitDeployment

      }
   }

   private EntityManagerFactory resolvePersistenceUnit(String unitName)
   {
      PersistenceUnitDeployment deployment = lookupPersistenceUnitDeployment(unitName);
      ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
      return new InjectedEntityManagerFactory(managedFactory);
   }
View Full Code Here

Examples of org.jboss.jpa.deployment.PersistenceUnitDeployment

      String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, unitName);
      if (beanName == null)
      {
         throw new IllegalStateException("No persistence unit available for " + unitName);
      }
      PersistenceUnitDeployment deployment = jbossEjb.lookupPersistenceUnitDeployment(beanName);
      return deployment;
   }
View Full Code Here

Examples of org.jboss.jpa.deployment.PersistenceUnitDeployment

      if(!(c instanceof ExtendedInjectionContainer))
         throw new UnsupportedOperationException("RemotePuEncInjector only works for ExtendedInjectionContainer");
      ExtendedInjectionContainer container = (ExtendedInjectionContainer) c;
     
      String name = container.resolvePersistenceUnitSupplier(unitName);
      PersistenceUnitDeployment deployment = ((PersistenceUnitDeployment) PersistenceUnitRegistry.getPersistenceUnit(name));
      RemotelyInjectEntityManagerFactory factory = new RemotelyInjectEntityManagerFactory(deployment.getXml(), "FIXME");
     
      try
      {
         Util.rebind(container.getEnc(), encName, factory);
      }
View Full Code Here

Examples of org.jboss.jpa.deployment.PersistenceUnitDeployment

*/
public class ManagedEntityManagerFactoryHelper
{
   public static ManagedEntityManagerFactory getManagedEntityManagerFactory(String kernelName)
   {
      PersistenceUnitDeployment pu = (PersistenceUnitDeployment) PersistenceUnitRegistry.getPersistenceUnit(kernelName);
      if(pu != null)
         return pu.getManagedFactory();
      return null;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.