Examples of RuntimeTest1


Examples of org.apache.openjpa.persistence.event.common.apps.RuntimeTest1

        timeToAMD.start();

        // create objects
        RuntimeTest1[] persistables = new RuntimeTest1[numObjects];
        for (int i = 0; i < persistables.length; i++) {
            persistables[i] = new RuntimeTest1("foo #" + i, i);
        }

        // add them, a commit per object
        for (int i = 0; i < persistables.length; i++) {
            startTx(pm);
View Full Code Here

Examples of org.apache.openjpa.persistence.event.common.apps.RuntimeTest1

        // deletes, and udpates

        // create objects
        RuntimeTest1[] persistables = new RuntimeTest1[numObjects];
        for (int i = 0; i < persistables.length; i++) {
            persistables[i] = new RuntimeTest1("foo #" + i, i);
        }

        // add them
        for (int i = 0; i < persistables.length; i++) {
            startTx(pm);
View Full Code Here

Examples of org.apache.openjpa.persistence.event.common.apps.RuntimeTest1

        timeToAMD.start();

        // create objects
        RuntimeTest1[] persistables = new RuntimeTest1[numObjects];
        for (int i = 0; i < persistables.length; i++) {
            persistables[i] = new RuntimeTest1("foo #" + i, i);
        }

        // add them
        for (int i = 0; i < persistables.length; i++) {
            startTx(pm);
View Full Code Here

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

        deleteAll(RuntimeTest1.class);

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

        RuntimeTest1 b = new RuntimeTest1("STRING", 10);
        RuntimeTest2 c = new RuntimeTest2("STRING2", 11);
        pm.persist(b);
        pm.persist(c);

        endTx(pm);
View Full Code Here

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

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

        // create a test object
        RuntimeTest1 a = new RuntimeTest1("foo", 3);
        pm.persist(a);

        endTx(pm);

        oid = pm.getObjectId(a);
View Full Code Here

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

    public void testNotDirtyAfterSameChange() {
        OpenJPAEntityManager pm = getPM();
        startTx(pm);

        RuntimeTest1 a = (RuntimeTest1) pm.find(RuntimeTest1.class, oid);
        a.setStringField(a.getStringField());
        OpenJPAStateManager sm = getStateManager(a, pm);
        FieldMetaData fmd = sm.getMetaData().getField("stringField");
        assertTrue(sm.getDirty().get(fmd.getIndex()) == false);

        endTx(pm);
View Full Code Here

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

                broker.getLifecycleEventManager().hasLoadListeners(
                    new RuntimeTest4("foo"),
                    repos.getMetaData(RuntimeTest4.class, null, true)));
            assertFalse("there should be listeners def for runtimetest1",
                broker.getLifecycleEventManager().hasLoadListeners
                    (new RuntimeTest1(), repos.getMetaData
                        (RuntimeTest1.class, null, true)));
            broker.close();
        } finally {
            pmfSPI.removeLifecycleListener(listener);
        }
View Full Code Here

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

    }

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

        RuntimeTest1 pc = new RuntimeTest1();
        pc.setIntField(1);
        pc.setIntField1(1);
        _oid = persist(pc);
    }
View Full Code Here

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

        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);

        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);
        npc.setIntField1(300);
        endTx(pm);

        assertEquals(200, pc.getIntField1());
        assertTrue(pm.isPersistent(npc));
        assertEquals(300, npc.getIntField1());
        endEm(pm);
    }
View Full Code Here

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

        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);

        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);
        rollbackTx(pm);

        assertEquals(1, pc.getIntField1());
        assertFalse(pm.isPersistent(npc));
        assertEquals(0, npc.getIntField1());
        endEm(pm);

        pm = getPM();
        try {
            RuntimeTest1 temp =
                (RuntimeTest1) pm.find(RuntimeTest1.class, noid);
            fail("Object should not exist." + temp.getIntField() + "::" +
                temp.getIntField1());
        } catch (Exception jonfe) {
        }
        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.