Examples of fetchInitialField()


Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        startTx(pm);
        RuntimeTest1 rt1 = getObject(pm);
        OpenJPAStateManager sm = getStateManager(rt1, pm);
        FieldMetaData fmd = sm.getMetaData().getField("stringField");
        assertEquals("TestInitialValueFetching",
            sm.fetchInitialField(fmd.getIndex()));
        rt1.setStringField("TestInitialValueFetching-2");
        assertEquals("TestInitialValueFetching",
            sm.fetchInitialField(fmd.getIndex()));
        endTx(pm);
        assertEquals("TestInitialValueFetching-2",
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        FieldMetaData fmd = sm.getMetaData().getField("stringField");
        assertEquals("TestInitialValueFetching",
            sm.fetchInitialField(fmd.getIndex()));
        rt1.setStringField("TestInitialValueFetching-2");
        assertEquals("TestInitialValueFetching",
            sm.fetchInitialField(fmd.getIndex()));
        endTx(pm);
        assertEquals("TestInitialValueFetching-2",
            sm.fetchInitialField(fmd.getIndex()));
        endEm(pm);
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        rt1.setStringField("TestInitialValueFetching-2");
        assertEquals("TestInitialValueFetching",
            sm.fetchInitialField(fmd.getIndex()));
        endTx(pm);
        assertEquals("TestInitialValueFetching-2",
            sm.fetchInitialField(fmd.getIndex()));
        endEm(pm);
    }

    public void testInitialValueInt() {
        OpenJPAEntityManager pm = getPM();
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        startTx(pm);
        RuntimeTest1 rt1 = getObject(pm);
        OpenJPAStateManager sm = getStateManager(rt1, pm);
        FieldMetaData fmd = sm.getMetaData().getField("intField1");
        assertEquals(10,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        rt1.setIntField1(11);
        assertEquals(10,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        endTx(pm);
        assertEquals(11,
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        FieldMetaData fmd = sm.getMetaData().getField("intField1");
        assertEquals(10,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        rt1.setIntField1(11);
        assertEquals(10,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        endTx(pm);
        assertEquals(11,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        endEm(pm);
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        rt1.setIntField1(11);
        assertEquals(10,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        endTx(pm);
        assertEquals(11,
            ((Integer) sm.fetchInitialField(fmd.getIndex())).intValue());
        endEm(pm);
    }

    public void testInitialValueMutableValueFailures() {
        Map props = new HashMap();
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        Date d = rt1.getDateField();
        OpenJPAStateManager sm = getStateManager(rt1, pm);
        FieldMetaData fmd = sm.getMetaData().getField("dateField");
        try {
            sm.fetchInitialField(fmd.getIndex());
            fail("should get an exception if RestoreMutableValues is false");
        } catch (org.apache.openjpa.util.UserException e) {
            // expected
        }
        endEm(pm);
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        Date d = rt1.getDateField();

        OpenJPAStateManager sm = getStateManager(rt1, pm);
        FieldMetaData fmd = sm.getMetaData().getField("dateField");
        assertEquals(d, sm.fetchInitialField(fmd.getIndex()));

        // == should pass here since we haven't made any modifications.
        assertTrue("mutable object fails == test; should not",
            d == sm.fetchInitialField(fmd.getIndex()));
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        FieldMetaData fmd = sm.getMetaData().getField("dateField");
        assertEquals(d, sm.fetchInitialField(fmd.getIndex()));

        // == should pass here since we haven't made any modifications.
        assertTrue("mutable object fails == test; should not",
            d == sm.fetchInitialField(fmd.getIndex()));

        Date d2 = new Date();
        rt1.setDateField(d2);
        assertEquals(d, sm.fetchInitialField(fmd.getIndex()));
        endTx(pm);
View Full Code Here

Examples of org.apache.openjpa.kernel.OpenJPAStateManager.fetchInitialField()

        assertTrue("mutable object fails == test; should not",
            d == sm.fetchInitialField(fmd.getIndex()));

        Date d2 = new Date();
        rt1.setDateField(d2);
        assertEquals(d, sm.fetchInitialField(fmd.getIndex()));
        endTx(pm);
        assertEquals(d2, sm.fetchInitialField(fmd.getIndex()));
        assertTrue("mutable object passes == test; should not",
            d2 != sm.fetchInitialField(fmd.getIndex()));
        endEm(pm);
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.