Package org.apache.openjpa.persistence

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


        Cache cache = emf.getCache();
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        try {
            CachedEntityStatistics e = createEntity(em);
            assertTrue(cache.contains(CachedEntityStatistics.class, e.getId()));
            em.clear();

            String delete = "DELETE FROM CachedEntityStatistics s WHERE s.id = :id";
            // execute update, this should NOT result in a cache eviction
            em.getTransaction().begin();
            assertEquals(1, em.createQuery(delete).setParameter("id", e.getId()).executeUpdate());
View Full Code Here


        fs.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(fs);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLFieldSub.query");
View Full Code Here

            em.getTransaction().begin();
            assertEquals(1, em.createQuery(delete).setParameter("id", e.getId()).executeUpdate());
            em.getTransaction().commit();
            assertTrue(cache.contains(CachedEntityStatistics.class, e.getId()));

            em.clear();
           
            CachedEntityStatistics postUpdate = em.find(CachedEntityStatistics.class, e.getId());
            assertNotNull(postUpdate);

        } finally {
View Full Code Here

        ps.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(ps);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLPropertySub2.query");
View Full Code Here

        fs.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(fs);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLFieldSub2.query");
View Full Code Here

        fs.setCreateDate(now);
       
        em.getTransaction().begin();
        em.persist(fs);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLMixedFieldSub.query");
View Full Code Here

       
        em.getTransaction().begin();
        em.persist(fs);
        em.persist(spe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLFieldSub3.query");
View Full Code Here

       
        em.getTransaction().begin();
        em.persist(ps);
        em.persist(sfe);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the property name to verify that
        // propety access is in use.
        Query qry = em.createNamedQuery("XMLPropertySub3.query");
View Full Code Here

       
        em.getTransaction().begin();
        em.persist(pe);
        em.getTransaction().commit();
       
        em.clear();
       
        Query qry = em.createNamedQuery("XMLPropEmbedEntity.query");
        qry.setParameter("id", pe.getId());
        qry.setParameter("name", "PropEmbedEntity");
        qry.setParameter("firstName", "J");
View Full Code Here

       
        em.getTransaction().begin();
        em.persist(fe);
        em.getTransaction().commit();
       
        em.clear();
       
        Query qry = em.createNamedQuery("XMLFieldEmbedEntity.query");
        qry.setParameter("id", fe.getId());
        qry.setParameter("name", "FieldEmbedEntity");
        qry.setParameter("firstName", "Walt");
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.