Examples of EntityManagerProxy


Examples of org.jboss.seam.persistence.EntityManagerProxy

   }
  
   private void initEntityManager()
   {
      entityManager = getEntityManagerFactoryFromJndiOrValueBinding().createEntityManager();
      entityManager = new EntityManagerProxy(entityManager);
      setEntityManagerFlushMode( PersistenceContexts.instance().getFlushMode() );

      for (Filter f: filters)
      {
         if ( f.isFilterEnabled() )
View Full Code Here

Examples of org.jboss.seam.persistence.EntityManagerProxy

         for ( BijectedAttribute ba: getComponent().getPersistenceContextAttributes() )
         {
            EntityManager entityManager = (EntityManager) ba.get(bean);
            if ( ! (entityManager instanceof EntityManagerProxy ) )
            {
               ba.set( bean, new EntityManagerProxy( entityManager ) );
            }
         }
      }
   }
View Full Code Here

Examples of org.springframework.orm.jpa.EntityManagerProxy

    EntityManager proxy = (EntityManager) proxyFactoryBean.getObject();
    assertSame(proxy, proxyFactoryBean.getObject());
    assertFalse(proxy.contains(o));

    assertTrue(proxy instanceof EntityManagerProxy);
    EntityManagerProxy emProxy = (EntityManagerProxy) proxy;
    try {
      emProxy.getTargetEntityManager();
      fail("Should have thrown IllegalStateException outside of transaction");
    }
    catch (IllegalStateException ex) {
      // expected
    }

    TransactionSynchronizationManager.bindResource(mockEmf, new EntityManagerHolder(mockEm));
    try {
      assertSame(mockEm, emProxy.getTargetEntityManager());
    }
    finally {
      TransactionSynchronizationManager.unbindResource(mockEmf);
    }
View Full Code Here

Examples of org.springframework.orm.jpa.EntityManagerProxy

    EntityManager proxy = proxyFactoryBean.getObject();
    assertSame(proxy, proxyFactoryBean.getObject());
    assertFalse(proxy.contains(o));

    assertTrue(proxy instanceof EntityManagerProxy);
    EntityManagerProxy emProxy = (EntityManagerProxy) proxy;
    try {
      emProxy.getTargetEntityManager();
      fail("Should have thrown IllegalStateException outside of transaction");
    }
    catch (IllegalStateException ex) {
      // expected
    }

    TransactionSynchronizationManager.bindResource(mockEmf, new EntityManagerHolder(mockEm));
    try {
      assertSame(mockEm, emProxy.getTargetEntityManager());
    }
    finally {
      TransactionSynchronizationManager.unbindResource(mockEmf);
    }
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.