Package org.apache.openjpa.jdbc.kernel

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


    public void testCascadeMerge() {
        EntityManager em = emf.createEntityManager();
        try {
            em.getTransaction().begin();
            EntityF enF = new EntityF();
            enF.setId(1);
            em.persist(enF);
            em.getTransaction().commit();
            em.close();

            em = emf.createEntityManager();
            em.getTransaction().begin();

            EntityF enF1 = em.find(EntityF.class, 1);
            enG1.setEntityF(enF1);
            enG2.setEntityF(enF1);
            List<EntityG> l = new ArrayList<EntityG>();
            l.add(enG1);
            l.add(enG2);
            enF1.setListG(l);
            em.merge(enG1);
            em.getTransaction().commit();
        }
        finally {
            if (em.getTransaction().isActive())
View Full Code Here

TOP

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

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.