Package org.apache.openjpa.jdbc.kernel

Examples of org.apache.openjpa.jdbc.kernel.EntityA


        OpenJPAEntityManagerSPI em2 = emf.createEntityManager();

        em1.getTransaction().begin();
        List<EntityA> entities = new ArrayList<EntityA>();
        for (int i = 0; i < 25; i++) {
            EntityA a = createEntity();
            entities.add(a);
            em1.persist(a);
        }
        em1.getTransaction().commit();
        em1.clear();

        em1.getTransaction().begin();
        em2.getTransaction().begin();
        for (EntityA a : entities) {
            EntityA a1 = em1.find(EntityA.class, a.getId());
            EntityA a2 = em2.find(EntityA.class, a.getId());
            a1.setName("asdf");
            a2.setName("asdf2");
        }
        em1.getTransaction().commit();
        try {
            em2.getTransaction().commit();
        } catch (RollbackException e) {
View Full Code Here


        }

    }

    EntityA createEntity() {
        EntityA res = new EntityA();
        EntityB b = new EntityB();
        EntityC c = new EntityC();
        EntityD d = new EntityD();

        res.setEntityB(b);
        b.setEntityC(c);
        c.setEntityD(d);

        return res;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.kernel.EntityA

Copyright © 2018 www.massapicom. 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.