Examples of persistAll()


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

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

        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persistAll(new Object[]{ pc, f1, f2, a1, a2 });
        em.getTransaction().commit();
        em.close();

        em = emf.createEntityManager();
        pc = em.find(AnnoTest1.class, new Long(1));
View Full Code Here

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

        c4.getMultiAs().add(a3);
        c4.getMultiAs().add(a4);
        a3.getMultiCs().add(c4);
        a4.getMultiCs().add(c4);
       
        pm.persistAll(os);
        pm.getTransaction().commit();
       
        a1oid = pm.getObjectId(a1);
        a2oid = pm.getObjectId(a2);
        a3oid = pm.getObjectId(a3);
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()

         ent.setDependent (depend);
         ent.getNoneCollection ().add (rel);

         OpenJPAEntityManager em = (OpenJPAEntityManager)currentEntityManager();
         startTx(em);
         em.persistAll (ent, rel, depend);
         endTx(em);
         long id = ent.getId ();
         long relId = rel.getId ();
         long dependId = depend.getId ();
         endEm(em);
View Full Code Here

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

         ent.setDependent (depend);
         depend.setAll (deep3);

         OpenJPAEntityManager em = (OpenJPAEntityManager)currentEntityManager();
         startTx(em);
         em.persistAll (ent, depend);
         endTx(em);
         long id = ent.getId ();
         long rel1Id = rel1.getId ();
         long rel2Id = rel2.getId ();
         long deep1Id = deep1.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

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