Package org.apache.openjpa.persistence

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


            "e.name = LOWER(e.name) WHERE e.name='Ugo'";

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

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

        em.getTransaction().commit();
        em.clear();
View Full Code Here


                "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());

        em.getTransaction().commit();
        em.clear();
View Full Code Here

            "e.name = UPPER(e.name) WHERE e.name='Ugo'";

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

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

        em.getTransaction().commit();
        em.clear();
View Full Code Here

                "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());

        em.getTransaction().commit();
        em.clear();
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);
        endEm(em);
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);
        endEm(em);
View Full Code Here

        assertEquals(makeDirtyBeforeRefresh, em.isDirty(pc));

        if (lock != null) {
            ((EntityManagerImpl)em).getFetchPlan().setReadLockMode(lock);
        }
        em.refresh(pc);
       
        assertEquals(expected, pc.getName());
        em.getTransaction().commit();
    }
   
View Full Code Here

        em.getTransaction().begin();
        em.getFetchPlan().setReadLockMode(lock);
        if (dirty)
            pc.setName("Dirty Name");
        try {
            em.refresh(pc);
            if (expectedExceptionType != null) {
                fail("expected " + expectedExceptionType.getSimpleName() +
                        " for PObject:" + oid);
            }
        } catch (Exception ex) {
View Full Code Here

            NativeSequenceEntity nse = new NativeSequenceEntity();
            nse.setName("Test");
            em.getTransaction().begin();
            em.persist(nse);
            em.getTransaction().commit();
            em.refresh(nse);
            // Validate the id is >= the initial value
            // Assert the sequence was created in the DB
            assertTrue(sequenceExists(em, NativeSequenceEntity.SCHEMA_NAME,
                NativeSequenceEntity.SEQ_NAME));
            // Assert the id is >= the initial value
View Full Code Here

            NativeORMSequenceEntity nse = new NativeORMSequenceEntity();
            nse.setName("TestORM");
            em.getTransaction().begin();
            em.persist(nse);
            em.getTransaction().commit();
            em.refresh(nse);
            // Assert the sequence was created in the DB
            assertTrue(sequenceExists(em, NativeORMSequenceEntity.SCHEMA_NAME,
                NativeORMSequenceEntity.SEQ_NAME));
            // Assert the id is >= the initial value
            assertTrue(nse.getId() >= 2000);
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.