Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()


        for (int i = 0; i < after; i++) {
            pc.setSelfOneOne(new ModRuntimeTest1());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
        assertFalse(pm.isPersistent(pc2));
        if (before > 0)
            assertEquals("before" + (before - 1),
                pc.getSelfOneOne().getStringField());
View Full Code Here


        for (int i = 0; i < after; i++) {
            pc.setSelfOneOne(new ModRuntimeTest1());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
        if (before > 0)
            assertEquals("before" + (before - 1),
                pc.getSelfOneOne().getStringField());
        else
View Full Code Here

        for (int i = 0; i < after; i++) {
            newElement(pc, "after" + i, (i + 1) * -10);
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");

        assertEquals("orig", pc.getStringField());
        assertFalse(pm.isRemoved(pc2));
        for (Iterator it = pc.getSelfOneMany().iterator(); it.hasNext();) {
            temp = (ModRuntimeTest1) it.next();
View Full Code Here

            //FIXME jthomas - setDateField
            //pc.setDateField(randomDate());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("value", pc.getStringField());
        assertEquals(333, pc.getIntField());
        //FIXME jthomas - setDateField
        //assertEquals(date, pc.getDateField());
        endTx(pm);
View Full Code Here

        for (int i = 0; i < after; i++) {
            pc.setStringField("a" + i);
            pm.setSavepoint("a" + i);
        }

        pm.rollbackToSavepoint("test");
        if (newPC)
            assertNull(pc.getEmbedded());
        else
            assertEquals(0, pc.getEmbedded().getIntField());
        assertEquals("test", pc.getStringField());
View Full Code Here

        for (int i = 0; i < after; i++) {
            pc.setStringField("b" + i);
            pm.setSavepoint("a" + i);
        }

        pm.rollbackToSavepoint("test");
        assertNotNull(pc.getEmbedded());
        assertEquals(1000, pc.getEmbedded().getIntField1());
        endTx(pm);
        endEm(pm);
    }
View Full Code Here

        for (int i = 0; i < after; i++) {
            pc.setStringField("a" + i);
            pm.setSavepoint("a" + i);
        }

        pm.rollbackToSavepoint("test");
        assertNotNull(pc.getEmbedded());
        assertEquals(1000, pc.getEmbedded().getIntField1());
        endTx(pm);
        endEm(pm);
    }
View Full Code Here

        for (int i = 0; i < after; i++) {
            pc.getEmbedded().setIntField1(i * -1);
            pm.setSavepoint("a" + i);
        }

        pm.rollbackToSavepoint("test");
        assertNotNull(pc.getEmbedded());
        if (before == 0)
            assertEquals(1000, pc.getEmbedded().getIntField1());
        else
            assertEquals(before - 1, pc.getEmbedded().getIntField1());
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.