Package org.apache.openjpa.persistence.kernel.common.apps

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


    }

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

        FetchGroupTestObject pc = new FetchGroupTestObject();
        pc.setA(1);
        pc.setB("2");
        pc.setC(new BigInteger("100"));

        OpenJPAEntityManager pm = getPM();
        //pm.getTransaction().begin();
        startTx(pm);
        pm.persist(pc);
View Full Code Here


        return pm;
    }

    public void testUnloadedFieldDirtiedBeforeLoadedField() {
        OpenJPAEntityManager pm = getPM();
        FetchGroupTestObject pc = (FetchGroupTestObject) pm.find
            (FetchGroupTestObject.class, _oid);

        assertNotNull("fetch object is null", pc);

        startTx(pm);
        pc.setB("3");
        pc.setA(2);
        rollbackTx(pm);

        assertEquals(1, pc.getA());
        assertEquals("2", pc.getB());
        assertEquals(new BigInteger("100"), pc.getC());
        endEm(pm);
    }
View Full Code Here

        endEm(pm);
    }

    public void testUnloadedFieldDirtiedAfterLoadedField() {
        OpenJPAEntityManager pm = getPM();
        FetchGroupTestObject pc = (FetchGroupTestObject) pm.find
            (FetchGroupTestObject.class, _oid);

        startTx(pm);
        pc.setA(2);
        pc.setB("3");
        rollbackTx(pm);

        assertEquals(1, pc.getA());
        assertEquals("2", pc.getB());
        assertEquals(new BigInteger("100"), pc.getC());
        endEm(pm);
    }
View Full Code Here

        endEm(pm);
    }

    public void testLoadedFieldDirtiedAfterLoadedField() {
        OpenJPAEntityManager pm = getPM();
        FetchGroupTestObject pc = (FetchGroupTestObject) pm.find
            (FetchGroupTestObject.class, _oid);

        startTx(pm);
        pc.setA(2);
        pc.getB();
        pc.setB("3");
        rollbackTx(pm);

        assertEquals(1, pc.getA());
        assertEquals("2", pc.getB());
        assertEquals(new BigInteger("100"), pc.getC());
        endEm(pm);
    }
View Full Code Here

        assertEquals(new BigInteger("100"), pc.getC());
        endEm(pm);
    }

    public void testNewInstanceUnmodifiedInTransaction() {
        FetchGroupTestObject pc = new FetchGroupTestObject();
        pc.setA(2);
        pc.setB("3");

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        pm.persist(pc);
        rollbackTx(pm);
        assertEquals(2, pc.getA());
        assertEquals("3", pc.getB());
        endEm(pm);
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.kernel.common.apps.FetchGroupTestObject

Copyright © 2018 www.massapicom. 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.