Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.Extent.list()


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

        List aList = ext.list();
        assertEquals(all.size(), aList.size());
        assertContainsSame(all, aList);
    }

    private void assertContainsSame(List l, Collection c) {
View Full Code Here


        extent.getFetchPlan().setFetchBatchSize(0);
        extent.getFetchPlan().addFetchGroup("rel");

        // if we only access the rel field, we should only have used 1 select
        List list = extent.list();
        assertEquals(4, list.size());
        assertRel(list, 4);
        assertEquals(sql.toString(), 1, sql.size());
        sql.clear();
View Full Code Here

        extent.getFetchPlan().addFetchGroup("rel");
        extent.getFetchPlan().addFetchGroup("rels");


        // we should get two selects: the initial select and the IN eager stmnt
        List list = extent.list();
        assertEquals(4, list.size());
        assertRel(list, 4);
        assertRels(list, 4);
        assertEquals(sql.toString(), 2, sql.size());
        assertTrue((String) sql.get(1),
View Full Code Here

        extent.getFetchPlan().setFetchBatchSize(0);
        extent.getFetchPlan().addFetchGroup("rel");
        extent.getFetchPlan().addFetchGroup("rels");

        // we should get two selects: the initial select and the IN eager stmnt
        List list = extent.list();
        assertEquals(4, list.size());
        assertAppIdRel(list, 4);
        assertAppIdRels(list, 4);
        assertEquals(sql.toString(), 2, sql.size());
        assertTrue((String) sql.get(1),
View Full Code Here

        extent.getFetchPlan().setFetchBatchSize(2);    // 2 pages of 2
        extent.getFetchPlan().addFetchGroup("rel");
        extent.getFetchPlan().addFetchGroup("rels");

        // we should get two selects: the initial select and the IN eager stmnt
        List list = extent.list();
        assertEquals(list.toString(), 4, list.size());
        assertRel(list, 4);
        assertRels(list, 4);
        assertEquals(sql.toString(), 3, sql.size());
        assertTrue((String) sql.get(1),
View Full Code Here

        extent.getFetchPlan().setFetchBatchSize(3);    // 1 on page 2
        extent.getFetchPlan().addFetchGroup("rel");
        extent.getFetchPlan().addFetchGroup("rels");

        // we should get two selects: the initial select and the IN eager stmnt
        List list = extent.list();
        assertEquals(list.toString(), 4, list.size());
        assertRel(list, 4);
        assertRels(list, 4);
        assertEquals(sql.toString(), 3, sql.size());
        assertTrue((String) sql.get(1),
View Full Code Here

    }

    protected FetchGroupTestObject getO1(OpenJPAEntityManager pm) {
        Extent e = (Extent) pm.createExtent(FetchGroupTestObject.class,
            true);
        List l = e.list();

        OpenJPAQuery q = pm.createQuery(
            "SELECT o FROM FetchGroupTestObject o WHERE o.a = 5");
        q.setCandidateCollection(l);
View Full Code Here

    }

    protected FetchGroupTestObject getO2(OpenJPAEntityManager pm) {
        Extent e = (Extent) pm.createExtent(FetchGroupTestObject.class,
            true);
        List l = e.list();

        OpenJPAQuery q = pm.createQuery(
            "SELECT o FROM FetchGroupTestObject o WHERE o.a = 3");
        q.setCandidateCollection(l);
View Full Code Here

    }

    protected FetchGroupTestObjectChild getC1(OpenJPAEntityManager pm) {
        Extent e = (Extent) pm.createExtent(FetchGroupTestObject.class,
            true);
        List l = e.list();

        OpenJPAQuery q = pm.createQuery(
            "SELECT o FROM FetchGroupTestObjectChild o WHERE o.a = 4");
        q.setCandidateCollection(l);
View Full Code Here

        extent.getFetchPlan().setFetchBatchSize(0);
        extent.getFetchPlan().addFetchGroup("rel");

        // if we only access the rel field, we should only have used 1 select
        List list = extent.list();
        assertEquals(4, list.size());
        assertRel(list, 4);
        assertEquals(sql.toString(), 1, sql.size());
        sql.clear();
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.