Examples of XMLDefPropMixedFieldAccess2


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

        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");
       
        em.getTransaction().begin();
        em.persist(dpmfa);
        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
        // property access is in use.
        qry = em.createNamedQuery("XMLDPMFA2.query");
        qry.setParameter("id", dpmfa.getId());
        qry.setParameter("strVal", "XMLDPMFA2");
        XMLDefPropMixedFieldAccess2 dpmfa2 =
            (XMLDefPropMixedFieldAccess2)qry.getSingleResult();
        assertEquals(dpmfa, dpmfa2);
        assertEquals(dpmfa2.getStrProp(), "XMLDPMFA2");

        try {
            qry = em.createNamedQuery("XMLDPMFA2.badQuery");
            qry.setParameter("id", dpmfa.getId());
            qry.setParameter("strVal", "XMLDPMFA2");
View Full Code Here

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

        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");
       
        em.getTransaction().begin();
        em.persist(dpmfa);
        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
        // property access is in use.
        qry = em.createNamedQuery("XMLDPMFA2.query");
        qry.setParameter("id", dpmfa.getId());
        qry.setParameter("strVal", "XMLDPMFA2");
        XMLDefPropMixedFieldAccess2 dpmfa2 =
            (XMLDefPropMixedFieldAccess2)qry.getSingleResult();
        assertEquals(dpmfa, dpmfa2);
        assertEquals(dpmfa2.getStrProp(), "XMLDPMFA2");

        try {
            qry = em.createNamedQuery("XMLDPMFA2.badQuery");
            qry.setParameter("id", dpmfa.getId());
            qry.setParameter("strVal", "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.