Examples of FetchGroupTestObject


Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    }

    public void setUp() {
        deleteAll(FetchGroupTestObject.class);

        FetchGroupTestObject o1 = new FetchGroupTestObject();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        o1.setA(5);
        o1.setB("foo");
        //o1.setC (new BigInteger (89));
        o1.setD(new Date());
        o1.setE("e-foo");
        o1.setF("f-foo");

        FetchGroupTestObject o2 = new FetchGroupTestObject();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        o2.setA(3);
        o2.setB("bar");
        //o2.setC (new BigInteger (13));
        o2.setD(new Date());
        o2.setE("e-bar");
        o2.setF("f-bar");
        o2.setG(o1);
        o2.setH(o1);

        FetchGroupTestObjectChild c1 = new FetchGroupTestObjectChild();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        c1.setA(4);
        c1.setB("child");
        c1.setD(new Date());
        c1.setE("e-baz");
        c1.setF("f-baz");
        c1.setG(o1);
        c1.setH(o1);
        c1.setChildA(1);
        c1.setChildB(2);
        c1.setChildC(3);
        c1.setChildD(4);

        OpenJPAEntityManager pm = getPM();
        startTx(pm);

        pm.persist(o1);
        pm.persist(o2);
        pm.persist(c1);
        endTx(pm);

        oid1 = o1.getId();
        oid2 = o2.getId();
        oidc1 = c1.getId();

        endEm(pm);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    }

    public void testFetchGroupsNoConfiguration() {
        OpenJPAEntityManager pm = getPM();

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // only field a should be loaded.
        checkObject(pm, o1, true, false, false, false, false, false);

        // upon loading field b, fields c and d should also be loaded,
        // but e and f should not.
        o1.getB();
        checkObject(pm, o1, true, true, true, true, false, false);

        // loading field h should not cause any of the others to be loaded.
        assertEquals(o1, o2.getH());
        checkObject(pm, o2, true, false, false, false, false, false);

        // loading field g should cause e and f to be loaded.
        assertEquals(o1, o2.getG());
        checkObject(pm, o2, true, false, false, false, true, true);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    }

    public void testRetrieveAll() {
        OpenJPAEntityManager pm = getPM();

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // only field a should be loaded.
        checkObject(pm, o1, true, false, false, false, false, false);
        checkObject(pm, o2, true, false, false, false, false, false);
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

        OpenJPAEntityManager pm = getPM();
        pm.getFetchPlan().addFetchGroup("g1");
        pm.getFetchPlan().addFetchGroup("g3");

        // get this so that h's value is loaded into cache.
        FetchGroupTestObject o1 = getO1(pm);

        FetchGroupTestObjectChild c1 = getC1(pm);

        // DFG fields and fields in groups 1 and 3 should be loaded
        checkChildObject(pm, c1, true, true, true, true, false, false,
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

        OpenJPAEntityManager pm = getPM();

        pm.getFetchPlan().addFetchGroup("g1");
        pm.getFetchPlan().addFetchGroup("g3");

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // DFG fields and fields in groups 1 and 3 should be loaded
        checkObject(pm, o1, true, true, true, true, false, false);

        // upon accessing field b, nothing should change.
        o1.getB();
        checkObject(pm, o1, true, true, true, true, false, false);

        // loading field h should not cause any of the others to be loaded.
        assertEquals(o1, o2.getH());
        checkObject(pm, o2, true, true, true, true, false, false);

        // loading field g should cause e and f to be loaded.
        assertEquals(o1, o2.getG());
        checkObject(pm, o2, true, true, true, true, true, true);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    public void setUp() throws Exception {
        super.setUp(FetchGroupTestObject.class, FetchGroupTestObjectChild.class,
            AttachA.class, AttachB.class, AttachC.class, AttachD.class, AttachE.class, AttachF.class);

        FetchGroupTestObject o1 = new FetchGroupTestObject();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        o1.setA(5);
        o1.setB("foo");
        //o1.setC (new BigInteger (89));
        o1.setD(new Date());
        o1.setE("e-foo");
        o1.setF("f-foo");

        FetchGroupTestObject o2 = new FetchGroupTestObject();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        o2.setA(3);
        o2.setB("bar");
        //o2.setC (new BigInteger (13));
        o2.setD(new Date());
        o2.setE("e-bar");
        o2.setF("f-bar");
        o2.setG(o1);
        o2.setH(o1);

        FetchGroupTestObjectChild c1 = new FetchGroupTestObjectChild();
        // the value that 'a' is set to is important -- TestFetchGroupsExtent
        // and TestFetchGroupsQuery rely on this
        c1.setA(4);
        c1.setB("child");
        c1.setD(new Date());
        c1.setE("e-baz");
        c1.setF("f-baz");
        c1.setG(o1);
        c1.setH(o1);
        c1.setChildA(1);
        c1.setChildB(2);
        c1.setChildC(3);
        c1.setChildD(4);

        OpenJPAEntityManager pm = getPM();
        startTx(pm);

        pm.persist(o1);
        pm.persist(o2);
        pm.persist(c1);
        endTx(pm);

        oid1 = o1.getId();
        oid2 = o2.getId();
        oidc1 = c1.getId();

        endEm(pm);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    }

    public void testFetchGroupsNoConfiguration() {
        OpenJPAEntityManager pm = getPM();

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // only field a should be loaded.
        checkObject(pm, o1, true, false, false, false, false, false);

        // upon loading field b, fields c and d should also be loaded,
        // but e and f should not.
        o1.getB();
        checkObject(pm, o1, true, true, true, true, false, false);

        // loading field h should not cause any of the others to be loaded.
        assertEquals(o1, o2.getH());
        checkObject(pm, o2, true, false, false, false, false, false);

        // loading field g should cause e and f to be loaded.
        assertEquals(o1, o2.getG());
        checkObject(pm, o2, true, false, false, false, true, true);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

    }

    public void testRetrieveAll() {
        OpenJPAEntityManager pm = getPM();

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // only field a should be loaded.
        checkObject(pm, o1, true, false, false, false, false, false);
        checkObject(pm, o2, true, false, false, false, false, false);
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

        OpenJPAEntityManager pm = getPM();
        pm.getFetchPlan().addFetchGroup("g1");
        pm.getFetchPlan().addFetchGroup("g3");

        // get this so that h's value is loaded into cache.
        FetchGroupTestObject o1 = getO1(pm);

        FetchGroupTestObjectChild c1 = getC1(pm);

        // DFG fields and fields in groups 1 and 3 should be loaded
        checkChildObject(pm, c1, true, true, true, true, false, false,
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

        OpenJPAEntityManager pm = getPM();

        pm.getFetchPlan().addFetchGroup("g1");
        pm.getFetchPlan().addFetchGroup("g3");

        FetchGroupTestObject o1 = getO1(pm);
        FetchGroupTestObject o2 = getO2(pm);

        // DFG fields and fields in groups 1 and 3 should be loaded
        checkObject(pm, o1, true, true, true, true, false, false);

        // upon accessing field b, nothing should change.
        o1.getB();
        checkObject(pm, o1, true, true, true, true, false, false);

        // loading field h should not cause any of the others to be loaded.
        assertEquals(o1, o2.getH());
        checkObject(pm, o2, true, true, true, true, false, false);

        // loading field g should cause e and f to be loaded.
        assertEquals(o1, o2.getG());
        checkObject(pm, o2, true, true, true, true, true, true);
    }
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.