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