Examples of ManagedEntityManagerFactory


Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }

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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

      return getEntityManagerFactory(unitName, container);
   }

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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }


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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }

   public void inject(InjectionContainer container)
   {
      String error1 = error;
      ManagedEntityManagerFactory factory = null;
      try
      {
         factory = PersistenceUnitHandler.getManagedEntityManagerFactory(
                 container, unitName);
      }
      catch (NameNotFoundException e)
      {
         error1 += " " + e.getMessage();
      }
      if (factory == null)
      {
         throw new RuntimeException(error1);
      }
      if (type == PersistenceContextType.EXTENDED)
      {
         if (!(container instanceof StatefulContainer))
            throw new RuntimeException("It is illegal to inject an EXTENDED PC into something other than a SFSB");
         container.getInjectors().add(0, new ExtendedPersistenceContextInjector(factory));
         Object extendedPc;
         if (injectionType == null
                 || injectionType.getName().equals(EntityManager.class.getName()))
         {
            extendedPc = new ExtendedEntityManager(factory.getKernelName());
         }
         else
         {
            ExtendedSessionInvocationHandler handler = new ExtendedSessionInvocationHandler(factory.getKernelName());
            extendedPc = Proxy.newProxyInstance(
                  Session.class.getClassLoader(), //use the Hibernate classloader so the proxy has the same scope as Hibernate
                  SESS_PROXY_INTERFACES,
                  handler
            );
View Full Code Here

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }

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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

      return getEntityManagerFactory(unitName, container);
   }

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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }


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

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

   }

   public void inject(InjectionContainer container)
   {
      String error1 = error;
      ManagedEntityManagerFactory factory = null;
      try
      {
         factory = PersistenceUnitHandler.getManagedEntityManagerFactory(
                 container, unitName);
      }
      catch (NameNotFoundException e)
      {
         error1 += " " + e.getMessage();
      }
      if (factory == null)
      {
         throw new RuntimeException(error1);
      }
      if (type == PersistenceContextType.EXTENDED)
      {
         if (!(container instanceof StatefulContainer))
            throw new RuntimeException("It is illegal to inject an EXTENDED PC into something other than a SFSB");
         container.getInjectors().add(0, new ExtendedPersistenceContextInjector(factory));
         Object extendedPc;
         if (injectionType == null
                 || injectionType.getName().equals(EntityManager.class.getName()))
         {
            extendedPc = new ExtendedEntityManager(factory.getKernelName());
         }
         else
         {
            ExtendedSessionInvocationHandler handler = new ExtendedSessionInvocationHandler(factory.getKernelName());
            extendedPc = Proxy.newProxyInstance(
                  Session.class.getClassLoader(), //use the Hibernate classloader so the proxy has the same scope as Hibernate
                  SESS_PROXY_INTERFACES,
                  handler
            );
View Full Code Here

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

/*     */
/*     */   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());
/*     */     }
/*     */     ManagedEntityManagerFactory factory;
/* 148 */     return factory;
/*     */   }
View Full Code Here

Examples of org.jboss.ejb3.entity.ManagedEntityManagerFactory

/*     */
/*     */   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;
/*     */     }
/*     */     ManagedEntityManagerFactory managedFactory;
/* 176 */     return new InjectedEntityManagerFactory(managedFactory);
/*     */   }
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.