Package javax.persistence

Examples of javax.persistence.EntityManagerFactory.createEntityManager()


   
    UserTransaction tm = context().getService(UserTransaction.class);
   
    tm.begin();
   
    emf.createEntityManager().getProperties();
   
    QuiesceParticipant participant = getParticipant("org.apache.aries.jpa.container.context");
   
    TestQuiesceCallback callback = new TestQuiesceCallback();
   
View Full Code Here


    context().getService(DataSource.class);
   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))");
   
    EntityManager em = emf.createEntityManager();
   
    QuiesceParticipant participant = getParticipant("org.apache.aries.jpa.container");
   
    TestQuiesceCallback callback = new TestQuiesceCallback();
   
View Full Code Here

    b.start();
   
    emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
        + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))");
   
    em = emf.createEntityManager();
    em.close();
   
    emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
        + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))", 100);
   
View Full Code Here

    emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
        + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))", 100);
   
    //Test a second time to make sure state isn't held
   
    em = emf.createEntityManager();
   
    callback = new TestQuiesceCallback();
   
    participant.quiesce(callback, Collections.singletonList(context().getBundleByName(
        "org.apache.aries.jpa.org.apache.aries.jpa.container.itest.bundle")));
View Full Code Here

   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))");
   
   
    EntityManager em = emf.createEntityManager();
   
    QuiesceParticipant participant = getParticipant("org.apache.aries.jpa.container");
   
    TestQuiesceCallback callback = new TestQuiesceCallback();
   
View Full Code Here

    //Set up a transaction so we can check the Quiesce waits properly
    UserTransaction tm = context().getService(UserTransaction.class);
   
    tm.begin();
   
    emf.createEntityManager().getProperties();
   
    //Quiesce the Unit, nothing should happen
    QuiesceParticipant participant = getParticipant("org.apache.aries.jpa.container");
   
    TestQuiesceCallback unitCallback = new TestQuiesceCallback();
View Full Code Here

   
    emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
        + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))");
 
 
    EntityManager em = emf.createEntityManager();
   
    tm.commit();
   
    assertTrue("Quiesce not finished", contextCallback.bundleClearedUp());
   
View Full Code Here

    //Set up a transaction so we can check the Quiesce waits properly
    UserTransaction tm = context().getService(UserTransaction.class);
   
    tm.begin();
   
    emf.createEntityManager().getProperties();
   
    //Quiesce the Unit, nothing should happen
    QuiesceParticipant participant = getParticipant("org.apache.aries.jpa.container");
   
    MultiQuiesceCallback callback = new MultiQuiesceCallback();
View Full Code Here

    private static EntityTransaction tx;

    @BeforeClass
    public static void initalizeEm() {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("integration");
        em = emf.createEntityManager();
        tx = em.getTransaction();
    }

    @Test
    public void findActive() {
View Full Code Here

  public void testProgrammaticAPI() throws Exception {
    Ejb3Configuration conf = new Ejb3Configuration();
    conf.addAnnotatedClass( Cat.class );
    conf.addProperties(getProperties());
    EntityManagerFactory emf = conf.buildEntityManagerFactory();
    EntityManager em = emf.createEntityManager();
    Cat cat = new Cat();
    cat.setAge( 23 );
    cat.setDateOfBirth( new Date() );
    cat.setLength( 32 );
    cat.setName( "Tomy" );
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.