Examples of persistAll()


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

        pc.getStringRels().add(rel2);
        pc.getStringRels().add(rel3);

        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
        startTx(em);
        em.persistAll(pc, rel1, rel2, rel3);
        endTx(em);
        endEm(em);

        em = (OpenJPAEntityManager) currentEntityManager();
        pc = em.find(OrderByEntity.class, 1L);
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()

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

        a1.setOneManyOwner(pc);
        a2.setOneManyOwner(pc);

        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
       startTx(em);
        em.persistAll(new Object[]{ pc, f1, f2, a1, a2 });
       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()

        pc.getStringRels().add(rel2);
        pc.getStringRels().add(rel3);

        OpenJPAEntityManager em = (OpenJPAEntityManager) currentEntityManager();
        startTx(em);
        em.persistAll(pc, rel1, rel2, rel3);
        endTx(em);
        endEm(em);

        em = (OpenJPAEntityManager) currentEntityManager();
        pc = em.find(OrderByEntity.class, 1L);
View Full Code Here

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
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.