Package org.apache.openjpa.persistence

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


        }

        // new openjpa-2.0.0 behavior, where detachAll() updates entities in-place
        // ArrayList<Entity20> e20ListCopy = new ArrayList<Entity20>(em.detachAll(e20List));
        // em.detachAll(e20List);   // for some reason calling with Collection causes a NPE, so use Object[] instead
        em.detachAll(e20List.get(0), e20List.get(1), e20List.get(2));
        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** testDetachAll20() - after EM.detachAll() verify e20List(" + i + ")");
            Entity20 e20 = e20List.get(i);
            // entity should not have any proxy classes (in-place updated) and is detached
View Full Code Here


        kem.close();
       
        kem = _pmf.createEntityManager();
        startTx(kem);
        Extent extent = (Extent) kem.createExtent(ByteArrayPKPC.class,false);
        kem.detachAll(extent.list());
        extent.closeAll();
       
        ByteArrayPKPC owner = new ByteArrayPKPC();
        kem.persist(owner);
        owner.setPK(new byte[]{ 100, 101 });
View Full Code Here

        }

        // new openjpa-2.0.0 behavior, where detachAll() updates entities in-place
        // ArrayList<Entity20> e20ListCopy = new ArrayList<Entity20>(em.detachAll(e20List));
        // em.detachAll(e20List);   // for some reason calling with Collection causes a NPE, so use Object[] instead
        em.detachAll(e20List.get(0), e20List.get(1), e20List.get(2));
        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** testDetachAll20() - after EM.detachAll() verify e20List(" + i + ")");
            Entity20 e20 = e20List.get(i);
            // entity should not have any proxy classes (in-place updated) and is detached
View Full Code Here

        kem.close();
       
        kem = _pmf.createEntityManager();
        startTx(kem);
        Extent extent = (Extent) kem.createExtent(ByteArrayPKPC.class,false);
        kem.detachAll(extent.list());
        extent.closeAll();
       
        ByteArrayPKPC owner = new ByteArrayPKPC();
        kem.persist(owner);
        owner.setPK(new byte[]{ 100, 101 });
View Full Code Here

        kem.close();
       
        kem = _pmf.createEntityManager();
        startTx(kem);
        Extent extent = (Extent) kem.createExtent(ByteArrayPKPC.class,false);
        kem.detachAll(extent.list());
        extent.closeAll();
       
        ByteArrayPKPC owner = new ByteArrayPKPC();
        kem.persist(owner);
        owner.setPK(new byte[]{ 100, 101 });
View Full Code Here

            assertFalse(em.isDetached(e20));
            verifySerializable(e20, true, false);
        }
       
        // pre openjpa-2.0.0 behavior, where detachAll() returned the updated entities
        ArrayList<Entity20> e20ListCopy = new ArrayList<Entity20>(em.detachAll(e20List));
        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** after EM.detachAll() verify e20List(" + i + ")");
            Entity20 e20 = e20List.get(i);
            // original entity should have proxy classes and should not be detached
View Full Code Here

        }

        // new openjpa-2.0.0 behavior, where detachAll() updates entities in-place
        // ArrayList<Entity20> e20ListCopy = new ArrayList<Entity20>(em.detachAll(e20List));
        // em.detachAll(e20List);   // for some reason calling with Collection causes a NPE, so use Object[] instead
        em.detachAll(e20List.get(0), e20List.get(1), e20List.get(2));
        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** after EM.detachAll() verify e20List(" + i + ")");
            Entity20 e20 = e20List.get(i);
            // entity should not have any proxy classes (in-place updated) and is detached
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.