Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.EntityManagerImpl.find()


            em.persist(lazy);
            em.flush();
            em.clear();

            // Should prime the cache
            em.find(CachedEntityStatistics.class, e.getId()).getLazyList();
            em.clear();
            sql.clear();

            CachedEntityStatistics c = em.find(CachedEntityStatistics.class, e.getId());
            c.getLazyList();
View Full Code Here


            // Should prime the cache
            em.find(CachedEntityStatistics.class, e.getId()).getLazyList();
            em.clear();
            sql.clear();

            CachedEntityStatistics c = em.find(CachedEntityStatistics.class, e.getId());
            c.getLazyList();
            assertEquals(0, sql.size());

            em.getTransaction().commit();
        } finally {
View Full Code Here

            em.flush();
            em.getTransaction().commit();
            em.clear();
   
            for (int i = 1; i < 3; i++) {
                TblParent p = em.find(TblParent.class, i);
                int pid = p.getParentId();
                assertEquals(pid, i);
                Collection<TblChild> children = p.getTblChildren();
                boolean hasChild = false;
                for (TblChild c : children) {
View Full Code Here

        em.flush();
        em.getTransaction().commit();
        em.clear();

        for (int i = 1; i < 3; i++) {
            TblParent p = em.find(TblParent.class, i);
            int pid = p.getParentId();
            assertEquals(pid, i);
            Collection<TblChild> children = p.getTblChildren();
            boolean hasChild = false;
            for (TblChild c : children) {
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);
        Map sqlCache = jstore.getQuerySQLCache();
        Set keys = sqlCache.keySet();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            //make sure there is an entry in the cache
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);

        assertFalse(jstore.isQuerySQLCacheOn());
       
        em.getTransaction().begin();
        em.remove(p);
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);

        assertTrue(jstore.isQuerySQLCacheOn());

        Map sqlCache = jstore.getQuerySQLCache();
        Set keys = sqlCache.keySet();
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);
        Map sqlCache = jstore.getQuerySQLCache();
        Set keys = sqlCache.keySet();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            //make sure there is an entry in the cache
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);
        Map sqlCache = jstore.getQuerySQLCache();
        Set keys = sqlCache.keySet();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            //make sure there is an entry in the cache
View Full Code Here

        p.setId(1);
        em.persist(p);
        em.flush();
        em.getTransaction().commit();
       
        Person p1 = em.find(Person.class, 1);
        Map sqlCache = jstore.getQuerySQLCache();
        Set keys = sqlCache.keySet();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            //make sure there is an entry in the cache
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.