clear(emf1);
closeEMF(emf1);
}
private void verifyDefaultFieldAccess(OpenJPAEntityManagerSPI em) {
XMLFieldAccess2 fa = new XMLFieldAccess2();
// Set the persistent field through a misnamed setter
fa.setStringField("XMLFieldAccess2");
em.getTransaction().begin();
em.persist(fa);
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("XMLFieldAccess2.query");
qry.setParameter("id", fa.getId());
qry.setParameter("strVal", "XMLFieldAccess2");
XMLFieldAccess2 fa2 = (XMLFieldAccess2)qry.getSingleResult();
assertEquals(fa.getId(), fa2.getId());
XMLDefFieldMixedPropAccess2 dfmpa = new XMLDefFieldMixedPropAccess2();
// Call non-PC setter
dfmpa.setStrField("NonPCSetter");
// Call setter with property access