Package org.apache.openjpa.persistence

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


    public void testConsistentDatastoreTransaction() {

        OpenJPAEntityManager pm = getPM();
        pm.setOptimistic(false);
        pm.validateChanges();        // no-op outside trans
        startTx(pm);

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);
View Full Code Here


        RuntimeTest1 npc = new RuntimeTest1();
        npc.setIntField(2);
        npc.setIntField1(2);
        pm.persist(npc);
        pm.validateChanges();

        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));

        pc.setIntField1(200);
View Full Code Here

    }

    public void testConsistentDatastoreTransactionWithRollback() {
        OpenJPAEntityManager pm = getPM();
        pm.setOptimistic(false);
        pm.validateChanges();        // no-op outside trans
        startTx(pm);

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);
View Full Code Here

        RuntimeTest1 npc = new RuntimeTest1();
        pm.persist(npc);
        Object noid = pm.getObjectId(npc);

        pm.validateChanges();
        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));

        pc.setIntField1(200);
        npc.setIntField1(300);
View Full Code Here

       }
    */
    public void testConsistentOptimisticTransaction() {
        OpenJPAEntityManager pm = getPM();
        pm.setOptimistic(true);
        pm.validateChanges();        // no-op outside trans
        startTx(pm);
        boolean hasConn = hasConnection(pm);

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);
View Full Code Here

        RuntimeTest1 npc = new RuntimeTest1();
        npc.setIntField(2);
        npc.setIntField1(2);
        pm.persist(npc);

        pm.validateChanges();
        if (!hasConn)
            assertFalse(hasConnection(pm));

        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));
View Full Code Here

    }

    public void testConsistentOptimisticTransactionWithRollback() {
        OpenJPAEntityManager pm = getPM();
        pm.setOptimistic(true);
        pm.validateChanges();        // no-op outside trans
        startTx(pm);
        boolean hasConn = hasConnection(pm);

        RuntimeTest1 pc = (RuntimeTest1) pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);
View Full Code Here

        RuntimeTest1 npc = new RuntimeTest1();
        pm.persist(npc);
        Object noid = pm.getObjectId(npc);

        pm.validateChanges();
        if (!hasConn)
            assertFalse(hasConnection(pm));

        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));
View Full Code Here

    public void testConsistentDatastoreTransaction() {

        OpenJPAEntityManager pm = getPM();
        pm.setOptimistic(false);
        pm.validateChanges();        // no-op outside trans
        startTx(pm);

        RuntimeTest1 pc = pm.find(RuntimeTest1.class, _oid);
        pc.setIntField1(100);
View Full Code Here

        RuntimeTest1 npc = new RuntimeTest1();
        npc.setIntField(2);
        npc.setIntField1(2);
        pm.persist(npc);
        pm.validateChanges();

        assertEquals(100, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));

        pc.setIntField1(200);
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.