Examples of createExtent()


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

    public void testExtentIteratorsReturnFalseForClosedExtent() {
        OpenJPAEntityManager em =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(em);
        Extent extent = em.createExtent(RuntimeTest1.class, true);

        Iterator i = extent.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        extent.closeAll();
View Full Code Here

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

    public void testExtentIteratorsThrowExceptionForClosedExtent() {
        OpenJPAEntityManager em =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(em);

        Extent extent = em.createExtent(RuntimeTest1.class, true);

        Iterator i = extent.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        extent.closeAll();
View Full Code Here

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

    public void testExtentIteratorsReturnFalseForClosedem() {
        OpenJPAEntityManager em =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(em);

        Extent extent = em.createExtent(RuntimeTest1.class, true);
        Iterator i = extent.iterator();
        if (!(i.hasNext()))
            fail("Iterator should have had next()");
        endTx(em);
        endEm(em);
View Full Code Here

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

    public void testMixedExtent() {
        createMixed();

        OpenJPAEntityManager em = emf.createEntityManager();
        Extent e = em.createExtent(MixedInterface.class, true);
        Set seen = new HashSet();
        int size = 0;
        for (Iterator it = e.iterator(); it.hasNext();) {
            seen.add(it.next().getClass());
            size++;
View Full Code Here

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

            size++;
        }
        assertEquals(3, size);
        assertEquals(2, seen.size());

        e = em.createExtent(MixedInterface.class, false);
        seen = new HashSet();
        size = 0;
        for (Iterator it = e.iterator(); it.hasNext();) {
            seen.add(it.next().getClass());
            size++;
View Full Code Here

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

    }
   
    public void testBaseExtentNoSubs()
    throws Exception {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        Extent extent = pm.createExtent(JoinSubclassBase.class, false);
        Iterator itr = extent.iterator();
        assertTrue(itr.hasNext());
        JoinSubclassBase pc = (JoinSubclassBase) itr.next();
        assertEquals(1, pc.getBaseField());
        assertEquals(JoinSubclassBase.class, pc.getClass());
View Full Code Here

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

    }
   
    public void testBaseExtentWithSubs()
    throws Exception {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        Extent extent = pm.createExtent(JoinSubclassBase.class, true);
        Collection pcs = new TreeSet(((Extent) extent).list());
        assertEquals(3, pcs.size());
        Iterator itr = pcs.iterator();
        for (int i = 0; i < 2; i++) {
            JoinSubclassBase pc = (JoinSubclassBase) itr.next();
View Full Code Here

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

    }
   
    public void testLeafExtent()
    throws Exception {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        Extent extent = pm.createExtent(JoinSubclassBaseSubFlat.class, false);
        Iterator itr = extent.iterator();
        assertTrue(itr.hasNext());
        JoinSubclassBaseSubFlat pc = (JoinSubclassBaseSubFlat) itr.next();
        assertEquals(3, pc.getBaseField());
        assertEquals(4, pc.getBaseSubVertField());
View Full Code Here

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

    }

    public void testExtent1() {

        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest1.class, false);

        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 testExtent2() {
        OpenJPAEntityManager pm = getPM();
        Extent ext = pm.createExtent(RuntimeTest1.class, false);

        boolean found = false;
        for (Iterator i = ext.iterator(); i.hasNext(); found = true)
            assertEquals(RuntimeTest1.class, i.next().getClass());
        assertTrue(found);
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.