Package org.apache.openjpa.persistence

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


     * This testcase was added for OPENJPA-1400.
     */
    public void testIsDetchedNoStateManagerZeroVersionField() {
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        NoDetachedStateEntityPropertyAccess property = em.find(NoDetachedStateEntityPropertyAccess.class, 1);
        NoDetachedStateEntityFieldAccess field = em.find(NoDetachedStateEntityFieldAccess.class, 1);
        em.close();

        PersistenceCapable pcProperty = (PersistenceCapable) property;
        PersistenceCapable pcField = (PersistenceCapable) field;

View Full Code Here


    /**
     * This testcase was added for OPENJPA-1400.
     */
    public void testPersistRelationshipToDetchedEntityZeroVersion() {
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        NoDetachedStateEntityPropertyAccess property = em.find(NoDetachedStateEntityPropertyAccess.class, 1);
        em.close();

        // Make sure we don't hit any exceptions when persisting a relationship to a detached
        // entity.
        em = emf.createEntityManager();
View Full Code Here

        // Make sure we don't hit any exceptions when persisting a relationship to a detached
        // entity.
        em = emf.createEntityManager();
        em.getTransaction().begin();
        NoDetachedStateEntityFieldAccess field = em.find(NoDetachedStateEntityFieldAccess.class, 1);
        field.setRelationship(property);
        em.getTransaction().commit();
        em.close();

        // Make sure that the relationship was persisted
View Full Code Here

        em.getTransaction().commit();
        em.close();

        // Make sure that the relationship was persisted
        em = emf.createEntityManager();
        field = em.find(NoDetachedStateEntityFieldAccess.class, 1);
        property = field.getRelationship();
        assertNotNull(property);
        assertEquals(1, property.getId());

    }
View Full Code Here

            // This testcase requires OPENJPA-612 to execute on MySQL.
            return;
        }
        em.getTransaction().begin();

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

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

        String query = "UPDATE CompUser e SET " +
            "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();
View Full Code Here

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

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

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

            // This testcase requires OPENJPA-612 to execute on MySQL.
            return;
        }
        em.getTransaction().begin();

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

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

        String query = "UPDATE CompUser e SET " +
            "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();
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.