Package org.apache.openjpa.persistence.merge.model

Examples of org.apache.openjpa.persistence.merge.model.ShipPackage


    public void testCascadeMergeDetachState() {
        EntityManager em = emf.createEntityManager();

        try {
            // Create simple bi-di graph
          ShipPackage p = new ShipPackage();
            Label l = new Label(p);
            p.setLabel(l);
           
            // Persist
            em.getTransaction().begin();
            em.persist(l);
            em.getTransaction().commit();

            // Detach
            em.clear();
            assertFalse(em.contains(l));
            assertFalse(em.contains(p));
            assertFalse(em.contains(l.getPackage()));
            assertFalse(em.contains(p.getLabel()));
           
            em.getTransaction().begin();
            Label mergedLabel = em.merge(l);

            assertFalse(mergedLabel == l);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.merge.model.ShipPackage

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.