Examples of XMLPropAccess2


Examples of org.apache.openjpa.persistence.access.xml.XMLPropAccess2

            // Expected exception
        }
    }

    private void verifyDefaultPropertyAccess(OpenJPAEntityManagerSPI em) {
        XMLPropAccess2 pa = new XMLPropAccess2();
        // Set the persistent field through a mis-named setter        
        pa.setStrProp("PropertyAccess");
       
        em.getTransaction().begin();
        em.persist(pa);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the field name to verify that
        // field access is in use.
        Query qry = em.createNamedQuery("XMLPropAccess2.query");
        qry.setParameter("id", pa.getId());
        qry.setParameter("strVal", "PropertyAccess");
        XMLPropAccess2 pa2 = (XMLPropAccess2)qry.getSingleResult();
        assertEquals(pa, pa2);

        XMLDefPropMixedFieldAccess2 dpmfa = new XMLDefPropMixedFieldAccess2();
        // Call setter with underlying field access
        dpmfa.setStrProp("XMLDPMFA2");
View Full Code Here

Examples of org.apache.openjpa.persistence.access.xml.XMLPropAccess2

            // Expected exception
        }
    }

    private void verifyDefaultPropertyAccess(OpenJPAEntityManagerSPI em) {
        XMLPropAccess2 pa = new XMLPropAccess2();
        // Set the persistent field through a mis-named setter        
        pa.setStrProp("PropertyAccess");
       
        em.getTransaction().begin();
        em.persist(pa);
        em.getTransaction().commit();
        em.clear();
       
        // This value of a persistent field was set using the setter
        // above, but this query will use the field name to verify that
        // field access is in use.
        Query qry = em.createNamedQuery("XMLPropAccess2.query");
        qry.setParameter("id", pa.getId());
        qry.setParameter("strVal", "PropertyAccess");
        XMLPropAccess2 pa2 = (XMLPropAccess2)qry.getSingleResult();
        assertEquals(pa, pa2);

        XMLDefPropMixedFieldAccess2 dpmfa = new XMLDefPropMixedFieldAccess2();
        // Call setter with underlying field access
        dpmfa.setStrProp("XMLDPMFA2");
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.