Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.refresh()


    CallbackStorage.clearStore();

    assertTrue(CallbackStorage.getInstance().getClist().isEmpty());

    emp = em.find(Employee.class, 6);
    em.refresh(emp);

    assertNotNull(emp);
    assertNotNull(CallbackStorage.getInstance().getClist());
    assertEquals("PostLoad is overfiring...not accurate", 2, CallbackStorage.getInstance().getClist().size());
    assertEquals("employeepol", CallbackStorage.getInstance().getClist().get(0));
View Full Code Here


         deep.setDependent (new CascadesEntity ());
         em.persistAll (ent.getAllCollection ());
         em.persist (ent.getDependent ());
         em.persist (rel.getDependent ());
         em.persist (deep.getDependent ());
         em.refresh (ent);
         assertNull (ent.getDependent ());
         assertEquals (1, ent.getAllCollection ().size ());
         assertTrue (ent.getAllCollection ().contains (rel));
         assertNull (rel.getDependent ());
         assertEquals (2, rel.getAllCollection ().size ());
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue(CallbackStorage.getInstance().getClist().isEmpty());

    lcd = em.find(LifeCycleDDEntity.class, id);
    em.refresh(lcd);

    assertNotNull(lcd);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals(2, CallbackStorage.getInstance().getClist().size());
        assertEquals("def-postload",
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue("not empty...", CallbackStorage.isEmpty());

    emp = em.find(LifeCycleDDEntity2.class, id);
    em.refresh(emp);

    assertNotNull(emp);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals(2, CallbackStorage.getInstance().getClist().size());
        assertEquals("def-postload",
View Full Code Here

        assertNotCached(Item.class, id);

        fItem.setItemData(updatedKey);
        assertEquals(updatedKey, fItem.getItemData());

        em.refresh(fItem, paramProperties);
        assertEquals(key, fItem.getItemData());
        assertNotCached(Item.class, id);

        Object mode = em.getProperties().get(JPAProperties.CACHE_STORE_MODE);
        assertEquals(mode, CacheStoreMode.USE);       
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue(CallbackStorage.getInstance().getClist().isEmpty());

    emp = em.find(Employee.class, 6);
    em.refresh(emp);

    assertNotNull(emp);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals("PostLoad is overfiring...not accurate", 2,
                CallbackStorage.getInstance().getClist().size());
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue(CallbackStorage.getInstance().getClist().isEmpty());

    lcd = em.find(LifeCycleDDEntity.class, id);
    em.refresh(lcd);

    assertNotNull(lcd);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals(2, CallbackStorage.getInstance().getClist().size());
        assertEquals("def-postload",
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue("not empty...", CallbackStorage.isEmpty());

    emp = em.find(LifeCycleDDEntity2.class, id);
    em.refresh(emp);

    assertNotNull(emp);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals(2, CallbackStorage.getInstance().getClist().size());
        assertEquals("def-postload",
View Full Code Here

    CallbackStorage.clearStore();

    assertTrue(CallbackStorage.getInstance().getClist().isEmpty());

    emp = em.find(Employee.class, 6);
    em.refresh(emp);

    assertNotNull(emp);
    assertNotNull(CallbackStorage.getInstance().getClist());
        assertEquals("PostLoad is overfiring...not accurate", 2,
                CallbackStorage.getInstance().getClist().size());
View Full Code Here

        try {
            pm2.getTransaction().commit();
            fail("Should have caused OL exception.");
        } catch (Exception jfe) {
            pm2.getTransaction().begin();
            pm2.refresh(pc2);
            pc2.setIntField(4);
            pm2.getTransaction().commit();
        }
       
        // make sure the next transaction works too
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.