Package org.apache.openjpa.persistence

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


        pc.setStringField("orig");
        pm.persist(pc);
        Object oid = pm.getObjectId(pc);

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

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
View Full Code Here


        pc2.setIntField(2);
        pc.setStateImage(pc2);
       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        pm.getTransaction().begin();
        pm.persist(pc);
        _oid = pm.getObjectId(pc);
        pm.getTransaction().commit();
        pm.close();
    }
   
View Full Code Here

        startTx(pm);
        ModRuntimeTest1 pc = new ModRuntimeTest1();
        pc.setStringField("orig");
        if (!nullRel)
            pc.setSelfOneOne(new ModRuntimeTest1("one", 1));
        pm.persist(pc);
        Object oid = pm.getObjectId(pc);
        endTx(pm);
        endEm(pm);

        pm = getPM();
View Full Code Here

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        ModRuntimeTest1 pc = new ModRuntimeTest1();
        pc.setStringField("orig");
        pc.setSelfOneOne(new ModRuntimeTest1("one", 1));
        pm.persist(pc);
        Object oid = pm.getObjectId(pc);
        endTx(pm);
        endEm(pm);

        pm = getPM();
View Full Code Here

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        ModRuntimeTest1 pc = new ModRuntimeTest1("orig", 1);
        ModRuntimeTest1 pc2 = newElement(pc, "persist", 2);
        ModRuntimeTest1 pc3 = newElement(pc, "delete", 3);
        pm.persist(pc);
        pm.persist(pc3);
        Object oid = pm.getObjectId(pc);
        ModRuntimeTest1 temp;
        if (!newPC) {
            endTx(pm);
View Full Code Here

        startTx(pm);
        ModRuntimeTest1 pc = new ModRuntimeTest1("orig", 1);
        ModRuntimeTest1 pc2 = newElement(pc, "persist", 2);
        ModRuntimeTest1 pc3 = newElement(pc, "delete", 3);
        pm.persist(pc);
        pm.persist(pc3);
        Object oid = pm.getObjectId(pc);
        ModRuntimeTest1 temp;
        if (!newPC) {
            endTx(pm);
            endEm(pm);
View Full Code Here

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
        RuntimeTest4 pc = new RuntimeTest4("orig");
        for (int i = 0; i < 12; i++)
            pc.getRuntimeTest5s().add(new RuntimeTest5("five" + i));
        pm.persist(pc);
        Object oid = pm.getObjectId(pc);
        endTx(pm);
        endEm(pm);

        pm = getPM();
View Full Code Here

        OpenJPAEntityManager pm = getEm(true, true);
        pm.getTransaction().begin();
        StateImagePC3 pc = new StateImagePC3();
        pc.setLockField(4);
        pc.setNoLockField(6);
        pm.persist(pc);
        pm.getTransaction().commit();
       
        pm.getTransaction().begin();
        pc.setLockField(6);
        sql.clear();
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        startTx(pm);;
        Base base = new Base();
        base.setBaseField(1);
        pm.persist(base);
       
        BaseSub1 sub1 = new BaseSub1();
        sub1.setBaseField(2);
        sub1.setBaseSub1Field(3);
        pm.persist(sub1);
View Full Code Here

        pm.persist(base);
       
        BaseSub1 sub1 = new BaseSub1();
        sub1.setBaseField(2);
        sub1.setBaseSub1Field(3);
        pm.persist(sub1);
       
        BaseSub2 sub2 = new BaseSub2();
        sub2.setBaseField(3);
        sub2.setBaseSub2Field(4);
        pm.persist(sub2);
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.