Examples of EagerOuterJoinPC


Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
        Iterator itr = results.iterator();
        EagerOuterJoinPC pc = (EagerOuterJoinPC) itr.next();
        assertEquals("1", pc.getName());
        assertEquals(2, pc.getManyManyCollection().size());
        pc = (EagerOuterJoinPC) itr.next();
        assertEquals("2", pc.getName());
        assertEquals(2, pc.getManyManyCollection().size());
        assertTrue(!itr.hasNext());
        pm.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        assertTrue(!itr.hasNext());
        pm.close();
    }
   
    private Object insertManyManyCollection() {
        EagerOuterJoinPC pc1 = new EagerOuterJoinPC();
        pc1.setName("1");
        EagerOuterJoinPC2 hpc = new EagerOuterJoinPC2();
        hpc.setName("1.1");
        pc1.getManyManyCollection().add(hpc);
        hpc = new EagerOuterJoinPC2();
        hpc.setName("1.2");
        pc1.getManyManyCollection().add(hpc);
       
        EagerOuterJoinPC pc2 = new EagerOuterJoinPC();
        pc2.setName("2");
        hpc = new EagerOuterJoinPC2();
        hpc.setName("2.1");
        pc2.getManyManyCollection().add(hpc);
        hpc = new EagerOuterJoinPC2();
        hpc.setName("2.2");
        pc2.getManyManyCollection().add(hpc);
       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        startTx(pm);
        pm.persist(pc1);
        pm.persist(pc2);
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        Object oid = insertManyManyList((empty) ? 1 : 0);
       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "manyManyList");
        EagerOuterJoinPC pc = (EagerOuterJoinPC) pm.getObjectId(oid);
        assertEquals("1", pc.getName());
        if (empty)
            assertEquals(0, pc.getManyManyList().size());
        else {
            assertEquals(2, pc.getManyManyList().size());
            EagerOuterJoinPC2 hpc = (EagerOuterJoinPC2)
            pc.getManyManyList().get(0);
            assertEquals("1.1", hpc.getName());
            hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
            assertEquals("1.2", hpc.getName());
        }
        pm.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
        Iterator itr = results.iterator();
        EagerOuterJoinPC pc = (EagerOuterJoinPC) itr.next();
        assertEquals("1", pc.getName());
        EagerOuterJoinPC2 hpc;
        if ((empty & 1) > 0)
            assertEquals(0, pc.getManyManyList().size());
        else {
            assertEquals(2, pc.getManyManyList().size());
            hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(0);
            assertEquals("1.1", hpc.getName());
            hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
            assertEquals("1.2", hpc.getName());
        }
       
        pc = (EagerOuterJoinPC) itr.next();
        assertEquals("2", pc.getName());
        if ((empty & 2) > 0)
            assertEquals(0, pc.getManyManyList().size());
        else {
            assertEquals(2, pc.getManyManyList().size());
            hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(0);
            assertEquals("2.1", hpc.getName());
            hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
            assertEquals("2.2", hpc.getName());
        }
       
        assertTrue(!itr.hasNext());
        pm.close();
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        assertTrue(!itr.hasNext());
        pm.close();
    }
   
    private Object insertManyManyList(int empty) {
        EagerOuterJoinPC pc1 = new EagerOuterJoinPC();
        pc1.setName("1");
        EagerOuterJoinPC2 hpc;
        if ((empty & 1) == 0) {
            hpc = new EagerOuterJoinPC2();
            hpc.setName("1.1");
            pc1.getManyManyList().add(hpc);
            hpc = new EagerOuterJoinPC2();
            hpc.setName("1.2");
            pc1.getManyManyList().add(hpc);
        }
       
        EagerOuterJoinPC pc2 = new EagerOuterJoinPC();
        pc2.setName("2");
        if ((empty & 2) == 0) {
            hpc = new EagerOuterJoinPC2();
            hpc.setName("2.1");
            pc2.getManyManyList().add(hpc);
            hpc = new EagerOuterJoinPC2();
            hpc.setName("2.2");
            pc2.getManyManyList().add(hpc);
        }
       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        startTx(pm);;
        pm.persist(pc1);
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "stringCollection");
        fetch.addField(EagerOuterJoinPC.class, "manyManyList");
        EagerOuterJoinPC pc = (EagerOuterJoinPC) pm.getObjectId(oid);
        assertEquals("1", pc.getName());
        assertEquals(2, pc.getStringCollection().size());
        assertTrue(pc.getStringCollection().contains("1.1"));
        assertTrue(pc.getStringCollection().contains("1.2"));
        assertEquals(2, pc.getManyManyList().size());
        EagerOuterJoinPC2 hpc = (EagerOuterJoinPC2)
        pc.getManyManyList().get(0);
        assertEquals("1.1", hpc.getName());
        hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
        assertEquals("1.2", hpc.getName());
        pm.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
        Iterator itr = results.iterator();
        EagerOuterJoinPC pc = (EagerOuterJoinPC) itr.next();
        assertEquals("1", pc.getName());
        assertEquals(2, pc.getStringCollection().size());
        assertTrue(pc.getStringCollection().contains("1.1"));
        assertTrue(pc.getStringCollection().contains("1.2"));
        assertEquals(2, pc.getManyManyList().size());
        EagerOuterJoinPC2 hpc = (EagerOuterJoinPC2)
        pc.getManyManyList().get(0);
        assertEquals("1.1", hpc.getName());
        hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
        assertEquals("1.2", hpc.getName());
       
        pc = (EagerOuterJoinPC) itr.next();
        assertEquals("2", pc.getName());
        assertEquals(2, pc.getStringCollection().size());
        assertTrue(pc.getStringCollection().contains("2.1"));
        assertTrue(pc.getStringCollection().contains("2.2"));
        assertEquals(2, pc.getManyManyList().size());
        hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(0);
        assertEquals("2.1", hpc.getName());
        hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
        assertEquals("2.2", hpc.getName());
       
        assertTrue(!itr.hasNext());
        pm.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        assertTrue(!itr.hasNext());
        pm.close();
    }
   
    private Object insertTwoCollections() {
        EagerOuterJoinPC pc1 = new EagerOuterJoinPC();
        pc1.setName("1");
        pc1.getStringCollection().add("1.1");
        pc1.getStringCollection().add("1.2");
        EagerOuterJoinPC2 hpc = new EagerOuterJoinPC2();
        hpc.setName("1.1");
        pc1.getManyManyList().add(hpc);
        hpc = new EagerOuterJoinPC2();
        hpc.setName("1.2");
        pc1.getManyManyList().add(hpc);
       
        EagerOuterJoinPC pc2 = new EagerOuterJoinPC();
        pc2.setName("2");
        pc2.getStringCollection().add("2.1");
        pc2.getStringCollection().add("2.2");
        hpc = new EagerOuterJoinPC2();
        hpc.setName("2.1");
        pc2.getManyManyList().add(hpc);
        hpc = new EagerOuterJoinPC2();
        hpc.setName("2.2");
        pc2.getManyManyList().add(hpc);
       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        startTx(pm);;
        pm.persist(pc1);
        pm.persist(pc2);
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

        //q.setOrdering("name ascending");
        List results = (List) q.getResultList();
        assertEquals(10, results.size());
       
        for (int i = 5; i < results.size(); i++) {
            EagerOuterJoinPC pc = (EagerOuterJoinPC) results.get(i);
            assertEquals(String.valueOf(i), pc.getName());
            assertEquals(2, pc.getStringList().size());
            assertEquals(i + ".1", pc.getStringList().get(0));
            assertEquals(i + ".2", pc.getStringList().get(1));
        }
        q.closeAll();
        pm.close();
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.common.apps.EagerOuterJoinPC

       
        List results = (List) q.getResultList();
        assertEquals(5, results.size());
       
        for (int i = 0; i < results.size(); i++) {
            EagerOuterJoinPC pc = (EagerOuterJoinPC) results.get(i);
            assertEquals(String.valueOf(i + 5), pc.getName());
            assertEquals(2, pc.getStringList().size());
            assertEquals((i + 5) + ".1", pc.getStringList().get(0));
            assertEquals((i + 5) + ".2", pc.getStringList().get(1));
        }
        q.closeAll();
        pm.close();
    }
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.