public void testUpdate2() {
OpenJPAEntityManager em =
(OpenJPAEntityManager) currentEntityManager();
startTx(em);
RuntimeTest1 run = em.find(RuntimeTest1.class, em.getObjectId(runt1));
assertNotNull(run);
assertEquals("runt1", run.getStringField());
assertNotNull(run.getSelfOneOne());
String ejbqlUpdate = "UPDATE RuntimeTest1 x " +
"SET x.stringField = :strngfld " +
"WHERE x.stringField = :field";
int upEntities = em.createQuery(ejbqlUpdate)
.setParameter("strngfld", "upd")
.setParameter("field", "runt1")
.executeUpdate();
assertEquals(1, upEntities);
endTx(em);
em = (OpenJPAEntityManager) currentEntityManager();
startTx(em);
RuntimeTest1 inst = em.find(RuntimeTest1.class, em.getObjectId(runt1));
em.refresh(inst);
assertNotNull(inst);
assertEquals("upd", inst.getStringField());
endTx(em);
endEm(em);
}