Examples of persistAll()


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

        startTx(em);
        AnnoTest1 pc = new AnnoTest1(5);
        pc.getOneMany().add(new AnnoTest2(15, "foo"));
        pc.getOneMany().add(new AnnoTest2(20, "foobar"));
        em.persist(pc);
        em.persistAll(pc.getOneMany());
        endTx(em);
        endEm(em);

        em = (OpenJPAEntityManager) currentEntityManager();
        pc = em.find(AnnoTest1.class, em.getObjectId(pc));
View Full Code Here

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

        pc2.setOneManyOwner(pc);
        pc2 = new AnnoTest2(20, "foobar");
        pc.getInverseOwnerOneMany().add(pc2);
        pc2.setOneManyOwner(pc);
        em.persist(pc);
        em.persistAll(pc.getInverseOwnerOneMany());
        endTx(em);
        endEm(em);

        em = (OpenJPAEntityManager)currentEntityManager();
        pc = em.find(AnnoTest1.class, em.getObjectId(pc));
View Full Code Here

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

        parent.setSub(sub);
        parent.setSup(sup);

        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persistAll(parent, sub, sup);
        em.getTransaction().commit();
        long pk = parent.getPK();
        em.close();

        em = emf.createEntityManager();
View Full Code Here

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

        os.add(new MultiD());
        d.setDString1("d string 1");
       
        EntityTransaction t = pm.getTransaction();
        t.begin();
        pm.persistAll(os);
        t.commit();
        aoid = pm.getObjectId(a);
        boid = pm.getObjectId(b);
        coid = pm.getObjectId(c);
        doid = pm.getObjectId(d);
View Full Code Here

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

        embed2.setBasic("basic");
        pc.getEmbedCollection().add(embed2);

        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persistAll(new Object[]{ pc, pc2, pc3 });
        em.getTransaction().commit();
        Object pcId = em.getObjectId(pc);
        Object pc2Id = em.getObjectId(pc2);
        Object pc3Id = em.getObjectId(pc3);
        em.close();
View Full Code Here

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

        parent.setSub(sub);
        parent.setSup(sup);

        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
        startTx(em);
        em.persistAll(parent, sub, sup);
        endTx(em);
        long pk = parent.getPK();
        endEm(em);

        em = (OpenJPAEntityManager) currentEntityManager();
View Full Code Here

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

        tpc2.setBasic(2);
        tpc2.setBasic2("2");
        ev = new EmbedValue();
        ev.setBasic("22");
        tpc2.setEmbed(ev);
        em.persistAll(tpc1, tpc2);
       endTx(em);
        int id1 = tpc1.getPk();
        int id2 = tpc2.getPk();
        endEm(em);
View Full Code Here

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

        rel.setValue("r");
        e.setRelation(rel);

        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
        startTx(em);
        em.persistAll(e, rel);
        endTx(em);
        endEm(em);
    }

    public void testGetObjectId() {
View Full Code Here

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

        //it explicitly causes a rollback
        //oid.setPk3(6);
        e1.setId(oid);
        e2.getId().setPk1(6);
        e2.getId().setPk2(7);
        em.persistAll(e1, e2);

        endTx(em);

        EmbeddedIdClass oid1 = e1.getId();
        EmbeddedIdClass oid2 = e2.getId();
View Full Code Here

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

         ent.setNone (rel);
         ent.getNoneCollection ().add (rel);

         OpenJPAEntityManager em = (OpenJPAEntityManager)currentEntityManager();
         startTx(em);
         em.persistAll (ent, rel);
         endTx(em);
         long id = ent.getId ();
         long relId = rel.getId ();
         endEm(em);
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.