Examples of createExtent()


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

        assertTrue(found);
    }

    public void testExtent3() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest1.class, true);

        boolean foundB = false;
        for (Iterator i = ext.iterator(); i.hasNext();)
            if (i.next().getClass().equals(RuntimeTest2.class))
                foundB = true;
View Full Code Here

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

        assertTrue(foundB);
    }

    public void testExtent4() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = (Extent) pm.createExtent(RuntimeTest1.class, true);

        List all = new LinkedList();
        for (Iterator i = ext.iterator(); i.hasNext();)
            all.add(i.next());
View Full Code Here

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

    }
    public void setUp() {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        startTx(pm);
       
        Extent e = pm.createExtent(LocatorTestObject.class, true);
        for (Iterator i = e.iterator(); i.hasNext();) {
            pm.remove(i.next());
           
        }
        endTx(pm);
View Full Code Here

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

        // test Extent
        {
            OpenJPAEntityManager pm = getPM();
            startTx(pm);
            Extent e = pm.createExtent(RuntimeTest1.class, true);
            assertTrue(e.iterator().hasNext());
            assertEquals("testSimple2", ((RuntimeTest1) e.iterator().next()).
                getStringField());
            endTx(pm);
            endEm(pm);
View Full Code Here

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

    }

    public void testInSecureClassLoader() {
        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        pm.createExtent(RuntimeTest1.class, true).iterator().hasNext();
        endTx(pm);
        endEm(pm);
    }

    public class StrictSecurityManager
View Full Code Here

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

        endEm(pm);
    }

    public void testProperties() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest2.class, false);
        assertEquals(pm, ext.getEntityManager());
        assertEquals(RuntimeTest2.class, ext.getElementClass());
        assertTrue(!ext.hasSubclasses());

        ext = pm.createExtent(RuntimeTest1.class, true);
View Full Code Here

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

        Extent ext = pm.createExtent(RuntimeTest2.class, false);
        assertEquals(pm, ext.getEntityManager());
        assertEquals(RuntimeTest2.class, ext.getElementClass());
        assertTrue(!ext.hasSubclasses());

        ext = pm.createExtent(RuntimeTest1.class, true);
        assertEquals(pm, ext.getEntityManager());
        assertEquals(RuntimeTest1.class, ext.getElementClass());
        assertTrue(ext.hasSubclasses());
    }
View Full Code Here

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

        assertTrue(ext.hasSubclasses());
    }

    public void testNoSubclasses() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest1.class, false);
        Iterator itr = ext.iterator();
        assertTrue(itr.hasNext());
        assertEquals(_oid1, pm.getObjectId(itr.next()));
        assertTrue(!itr.hasNext());
        ext.closeAll();
View Full Code Here

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

        ext.closeAll();
    }

    public void testSubclasses() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest1.class, true);

        int test1Count = 0;
        int test2Count = 0;
        int test3Count = 0;
        Object next;
View Full Code Here

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

        try {
            pm.persist(test1);
            pm.persist(test2);
            Object newOid = pm.getObjectId(test1);

            Extent ext = pm.createExtent(RuntimeTest1.class, false);
            boolean foundOid1 = false;
            boolean foundNew = false;
            Object next;
            for (Iterator itr = ext.iterator(); itr.hasNext();) {
                next = pm.getObjectId(itr.next());
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.