Package javax.persistence

Examples of javax.persistence.EntityManager.unwrap()


            List<WeakReference<EntityManager>> xpcs = SFSBXPCMap.getINSTANCE().getXPC(handle);
            if (xpcs == null)
                continue;
            for (WeakReference<EntityManager> xpc_ref : xpcs) {
                EntityManager xpc = xpc_ref.get();
                if (xpc != null && xpc.unwrap(EntityManagerMetadata.class).getScopedPuName().equals(puScopedName)) {
                    return xpc;
                }
            }
        }
        return null;
View Full Code Here


  public <T> T unwrap(Class<T> cls)
  {
    EntityManager em = getCurrent();
   
    if (em != null) {
      return em.unwrap(cls);
    }
   
    em = createEntityManager();
   
    try {
View Full Code Here

    }
   
    em = createEntityManager();
   
    try {
      return em.unwrap(cls);
    } finally {
      freeEntityManager(em);
    }
  }
View Full Code Here

        if (reference.getProperty("org.apache.aries.jpa.proxy.factory") != null) {
            return;
        }
        try {
            EntityManager em = emf.createEntityManager();
            SessionFactory sessionFactory = em.unwrap(Session.class).getSessionFactory();
            final Statistics statistics = sessionFactory.getStatistics();
            statistics.setStatisticsEnabled(true);
            mbeanServer.registerMBean(getStatisticsMBean(statistics), getOName(reference));
        } catch (Exception e) {
            LOG.warn("Error publishing StatisticsMXBean" + e.getMessage(), e);
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.