Package org.apache.openjpa.persistence

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


        oem.getTransaction().begin();
        oem.persist(ce);
        oem.getTransaction().commit();
        oem.clear();
        assertTrue(oemf.getCache().contains(CacheableEntity.class, id));
        ce = oem.find(CacheableEntity.class, id);
       
        assertTrue(dci.getHitCount() > 0);
        assertTrue(dci.getReadCount() > 0);
        assertTrue(dci.getWriteCount() > 0);
View Full Code Here


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

            CachedEntityStatistics postUpdate = em.find(CachedEntityStatistics.class, e.getId());
            assertNotEquals(name, postUpdate.getFirstName());
        }finally{
            emf.close();
        }
    }
View Full Code Here

            em.getTransaction().commit();
            assertTrue(cache.contains(CachedEntityStatistics.class, e.getId()));

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

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

        if (!dict.supportsCaseConversionForLob) {
            return;
        }
        startTx(em);

        CompUser user = em.find(CompUser.class, userid5);
        assertNotNull(user);
        assertEquals("Famzy", user.getName());

        String query = "UPDATE CompUser e SET e.name = LOWER(e.name) WHERE LOWER(e.nameAsLob)='famzy'";
View Full Code Here

        String query = "UPDATE CompUser e SET e.name = LOWER(e.name) WHERE LOWER(e.nameAsLob)='famzy'";

        int result = em.createQuery(query).executeUpdate();

        user = em.find(CompUser.class, userid5);
        em.refresh(user);
        assertNotNull(user);
        assertEquals("famzy", user.getName());

        endTx(em);
View Full Code Here

        if (!dict.supportsCaseConversionForLob) {
            return;
        }
        startTx(em);

        CompUser user = em.find(CompUser.class, userid5);
        assertNotNull(user);
        assertEquals("Famzy", user.getName());

        String query = "UPDATE CompUser e SET e.name = UPPER(e.name) WHERE UPPER(e.nameAsLob)='FAMZY'";
View Full Code Here

        String query = "UPDATE CompUser e SET e.name = UPPER(e.name) WHERE UPPER(e.nameAsLob)='FAMZY'";

        int result = em.createQuery(query).executeUpdate();

        user = em.find(CompUser.class, userid5);
        em.refresh(user);
        assertNotNull(user);
        assertEquals("FAMZY", user.getName());

        endTx(em);
View Full Code Here

    @Override
    public void setUp() throws Exception {
        super.setUp(args);
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        try {
            if (em.find(IntVersionEntity.class, 1) == null) {
                em.getTransaction().begin();
                _ive = new IntVersionEntity(1);
                _nve = new NoVersionEntity(1);
                _integerVe = new IntegerVersionEntity(1);
View Full Code Here

            em.merge(detachedIve);
            em.getTransaction().commit();

            em.clear();

            detachedIntegerVe = em.find(IntegerVersionEntity.class, _integerVe.getId());
            detachedNve = em.find(NoVersionEntity.class, _nve.getId());
            detachedIve = em.find(IntVersionEntity.class, _ive.getId());

            // Make sure the updated values were persisted
            assertEquals(detachedIntegerVe.getName(), updatedName);
View Full Code Here

            em.getTransaction().commit();

            em.clear();

            detachedIntegerVe = em.find(IntegerVersionEntity.class, _integerVe.getId());
            detachedNve = em.find(NoVersionEntity.class, _nve.getId());
            detachedIve = em.find(IntVersionEntity.class, _ive.getId());

            // Make sure the updated values were persisted
            assertEquals(detachedIntegerVe.getName(), updatedName);
            assertEquals(detachedNve.getName(), updatedName);
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.