Package org.apache.openjpa.persistence

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


            em.flush();
            // Post-persist invoked
            assertStatus(1, 1, 0, 0, 0, 0, 0);

            em.clear();

            // Perform a simple query to get the Message
            Query q = em.createQuery("select m from Message m where m.id="
                + message.getId());
            Message m = (Message) q.getSingleResult();
View Full Code Here


            java.util.List<NonstandardMappingEntity4> list = query.getResultList();
            for (NonstandardMappingEntity4 pc1 : list) {
                assertEquals(1.0, pc1.getPoint().getX());
                assertEquals(2.0, pc1.getPoint().getY());
            }
            em.clear();
        }
       
        em.close();
    }}
View Full Code Here

            log.trace("IgnoreDetachedStateFieldForProxySerialization=" +
                compat.getIgnoreDetachedStateFieldForProxySerialization());
        }

        OpenJPAEntityManager em = emf2.createEntityManager();
        em.clear();
       
        Entity20 e20 = em.find(Entity20.class, id);
        if (log.isTraceEnabled())
            log.trace("** testDetach20() - after find");
        assertTrue(em.contains(e20));
View Full Code Here

            log.trace("IgnoreDetachedStateFieldForProxySerialization=" +
                compat.getIgnoreDetachedStateFieldForProxySerialization());
        }

        OpenJPAEntityManager em = emf2.createEntityManager();
        em.clear();

        Entity20 e20 = em.find(Entity20.class, id);
        if (log.isTraceEnabled())
            log.trace("** testDetachCopy20() - after find");
        assertTrue(em.contains(e20));
View Full Code Here

            log.trace("IgnoreDetachedStateFieldForProxySerialization=" +
                compat.getIgnoreDetachedStateFieldForProxySerialization());
        }

        OpenJPAEntityManager em = emf2.createEntityManager();
        em.clear();

        ArrayList<Entity20> e20List = new ArrayList<Entity20>(numEntities);
        for (int i=0; i<numEntities; i++) {
            Entity20 e20 = em.find(Entity20.class, new Integer(i));
            e20List.add(e20);
View Full Code Here

            log.trace("IgnoreDetachedStateFieldForProxySerialization=" +
                compat.getIgnoreDetachedStateFieldForProxySerialization());
        }

        OpenJPAEntityManager em = emf1.createEntityManager();
        em.clear();

        ArrayList<Entity20> e20List = new ArrayList<Entity20>(numEntities);
        for (int i=0; i<numEntities; i++) {
            Entity20 e20 = em.find(Entity20.class, new Integer(i));
            e20List.add(e20);
View Full Code Here

                getLog().trace("testQueryTimeout6() - EM find/update runTime" +
                    " msecs=" + runTime);
                // Hack - Windows sometimes returns 1999 instead of 2000+
                assertTrue("Should have taken 2+ secs, but was msecs=" +
                    runTime, runTime > 1900);
                em.clear();
                qt = em.find(QTimeout.class, new Integer(1));
                assertEquals("Verify the entity was updated.",
                    qt.getStringField(), "updated");
            } catch (Exception e) {
                // setting a timeout property via PU or Map shouldn't cause a
View Full Code Here

            assertTrue(em.contains(e20));
            assertFalse(em.isDetached(e20));
            verifySerializable(e20, true, false);           
        }

        em.clear();

        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** testClear10Compat() - after EM.clear() verify Entity20(" + i + ")");
            Entity20 e20 = e20List.get(i);
View Full Code Here

            log.trace("IgnoreDetachedStateFieldForProxySerialization=" +
                compat.getIgnoreDetachedStateFieldForProxySerialization());
        }

        OpenJPAEntityManager em = emf2.createEntityManager();
        em.clear();

        ArrayList<Entity20> e20List = new ArrayList<Entity20>(numEntities);
        for (int i=0; i<numEntities; i++) {
            Entity20 e20 = em.find(Entity20.class, new Integer(i));
            e20List.add(e20);
View Full Code Here

            assertTrue(em.contains(e20));
            assertFalse(em.isDetached(e20));
            verifySerializable(e20, true, false);           
        }

        em.clear();

        for (int i=0; i<numEntities; i++) {
            if (log.isTraceEnabled())
                log.trace("** testClear20Compat() - after EM.clear() verify Entity20(" + i + ")");
            Entity20 e20 = e20List.get(i);
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.