Package org.apache.openjpa.persistence

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


            em = emf.createEntityManager();
            un = em.find(getUnenhancedClass(), un.getId());
            assertTrue(getUnenhancedClass() != un.getClass());
        }

        em.evict(un);
        OpenJPAStateManager sm = (OpenJPAStateManager)
            ImplHelper.toPersistenceCapable(un, null).pcGetStateManager();

        // we only expect lazy loading to work when we can redefine classes
        // or when accessing a property-access record that OpenJPA created.
View Full Code Here


            pc.getComp() instanceof Proxy);
        assertTrue(
            "(TreeSet) is not pc.getComp()).comparator() instanceof ComparableComparator",
            ((TreeSet) pc.getComp())
                .comparator() instanceof ComparableComparator);
        pm.evict(pc);
        endTx(pm);

        // see if it still saves comparator after transition to hollow
        // and back
        assertTrue("pc.getComp() is not instanceof ProxyTreeSet",
View Full Code Here

            em = emf.createEntityManager();
            un = em.find(getUnenhancedClass(), un.getId());
            assertTrue(getUnenhancedClass() != un.getClass());
        }

        em.evict(un);
        OpenJPAStateManager sm = (OpenJPAStateManager)
            ImplHelper.toPersistenceCapable(un, null).pcGetStateManager();

        // we only expect lazy loading to work when we can redefine classes
        // or when accessing a property-access record that OpenJPA created.
View Full Code Here

        FieldMetaData fmd = sm.getMetaData().getField("stringField");
        assertEquals("foo", sm.fetch(fmd.getIndex()));
        assertTrue(sm.getLoaded().get(fmd.getIndex()));

        pm.evict(basic);
        assertFalse(sm.getLoaded().get(fmd.getIndex()));
        // lazy loading
        assertNotNull(basic.getStringField());
        assertEquals("foo", sm.fetch(fmd.getIndex()));
        assertEquals("foo", basic.getStringField());
View Full Code Here

            AllFieldTypesTest aftt = new AllFieldTypesTest();
            aftt.setTestBigDecimal(bd);
            pm.persist(aftt);
            endTx(pm);
            Object id = pm.getObjectId(aftt);
            pm.evict(aftt);

            pm2 = getPM();
            startTx(pm);
            AllFieldTypesTest aftt2 = (AllFieldTypesTest) pm2.getObjectId(id);
View Full Code Here

            pc.getComp() instanceof Proxy);
        assertTrue(
  "(TreeSet) is not pc.getComp()).comparator() instanceof ComparableComparator",
            ((TreeSet) pc.getComp())
                .comparator() instanceof ComparableComparator);
        pm.evict(pc);
        endTx(pm);

        // see if it still saves comparator after transition to hollow
        // and back
        assertTrue("pc.getComp() is not instanceof ProxyTreeSet",
View Full Code Here

        FieldMetaData fmd = sm.getMetaData().getField("stringField");
        assertEquals("foo", sm.fetch(fmd.getIndex()));
        assertTrue(sm.getLoaded().get(fmd.getIndex()));

        pm.evict(basic);
        assertFalse(sm.getLoaded().get(fmd.getIndex()));
        // lazy loading
        assertNotNull(basic.getStringField());
        assertEquals("foo", sm.fetch(fmd.getIndex()));
        assertEquals("foo", basic.getStringField());
View Full Code Here

            em = emf.createEntityManager();
            un = em.find(getUnenhancedClass(), un.getId());
            assertTrue(getUnenhancedClass() != un.getClass());
        }

        em.evict(un);
        OpenJPAStateManager sm = (OpenJPAStateManager)
            ImplHelper.toPersistenceCapable(un, null).pcGetStateManager();

        // we only expect lazy loading to work when we can redefine classes
        // or when accessing a property-access record that OpenJPA created.
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.