Examples of PersistenceUnitDeployment


Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

      }
   }

   public static void addPUDependency(String unitName, InjectionContainer container) throws NameNotFoundException
   {
      PersistenceUnitDeployment deployment = null;
      // look in EAR first
      deployment = container.getPersistenceUnitDeployment(unitName);
      if (deployment != null)
      {
         container.getDependencyPolicy().addDependency(deployment.getKernelName());
         log.debug("***** adding PU dependency from located persistence unit: " + deployment.getKernelName());
         return;
      }
      // probably not deployed yet.
      // todo not sure if we should do this in JBoss 5
      log.warn("Could not find PU dependency for " + PersistenceUnitDeployment.getDefaultKernelName(unitName) + ". Waiting for dependency to resolve");
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

   public static ManagedEntityManagerFactory getManagedEntityManagerFactory(InjectionContainer container, String unitName)
           throws NameNotFoundException
   {
      ManagedEntityManagerFactory factory;
      PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
      if (deployment != null)
      {
         factory = deployment.getManagedFactory();
      }
      else
      {
         throw new NameNotFoundException("Unable to find persistence unit: " + unitName + " for deployment: " + container.getIdentifier());
      }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

   }

   public static EntityManagerFactory getEntityManagerFactory(String unitName, InjectionContainer container) throws NameNotFoundException
   {
      ManagedEntityManagerFactory managedFactory;
      PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
      if (deployment != null)
      {
         managedFactory = deployment.getManagedFactory();
      }
      else
      {
         return null;
      }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment


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

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            return null;
         }
         PersistenceUnitDeployment rtn = dep.getPersistenceUnitDeploymentInternal(name);
         return rtn;
      }
      PersistenceUnitDeployment rtn = getPersistenceUnitDeploymentInternal(unitName);
      if (rtn != null) return rtn;

      for (PersistenceUnitDeployment deployment : PersistenceUnitRegistry.getPersistenceUnits())
      {
         if (deployment.isScoped()) continue;
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.ejb3.entity.PersistenceUnitDeployment

/*     */     }
/*     */   }
/*     */
/*     */   public static void addPUDependency(String unitName, InjectionContainer container) throws NameNotFoundException
/*     */   {
/* 120 */     PersistenceUnitDeployment deployment = null;
/*     */
/* 122 */     deployment = container.getPersistenceUnitDeployment(unitName);
/* 123 */     if (deployment != null)
/*     */     {
/* 125 */       container.getDependencyPolicy().addDependency(deployment.getKernelName());
/* 126 */       log.debug("***** adding PU dependency from located persistence unit: " + deployment.getKernelName());
/* 127 */       return;
/*     */     }
/*     */
/* 131 */     log.debug("******* could not find PU dependency so adding a default: " + PersistenceUnitDeployment.getDefaultKernelName(unitName));
/* 132 */     container.getDependencyPolicy().addDependency(PersistenceUnitDeployment.getDefaultKernelName(unitName));
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/*     */   }
/*     */
/*     */   public static ManagedEntityManagerFactory getManagedEntityManagerFactory(InjectionContainer container, String unitName)
/*     */     throws NameNotFoundException
/*     */   {
/* 139 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
/*     */     ManagedEntityManagerFactory factory;
/* 140 */     if (deployment != null)
/*     */     {
/* 142 */       factory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 146 */       throw new NameNotFoundException("Unable to find persistence unit: " + unitName + " for deployment: " + container.getIdentifier());
/*     */     }
View Full Code Here

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment

/*     */   }
/*     */
/*     */   public static EntityManagerFactory getEntityManagerFactory(String unitName, InjectionContainer container)
/*     */     throws NameNotFoundException
/*     */   {
/* 167 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
/*     */     ManagedEntityManagerFactory managedFactory;
/* 168 */     if (deployment != null)
/*     */     {
/* 170 */       managedFactory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 174 */       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.