Package org.apache.openjpa.jdbc.kernel

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


                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();

        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here


                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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);
        em.flush();
        em.getTransaction().commit();
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            assertTrue((cacheMap instanceof
                org.apache.openjpa.kernel.TestQuerySQLCache.CustomCacheMap));
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();

        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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);
        em.flush();
        em.getTransaction().commit();
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            Map cacheMap = (Map) iter.next();
            assertTrue((cacheMap instanceof
                org.apache.openjpa.kernel.TestQuerySQLCache.CustomCacheMap));
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();

        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        BrokerImpl broker = (BrokerImpl) em.getBroker();
        DelegatingStoreManager dstore = broker.getStoreManager();
        JDBCStoreManager jstore =
            (JDBCStoreManager)dstore.getInnermostDelegate();
       
        em.getTransaction().begin();
        Person p = new Person();
        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
            assertEquals(1, cacheMap.size());  
View Full Code Here

TOP

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

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.