public void testUpdateWithCorrelatedSubquery() {
String update = "update Customer c set c.creditRating = ?1 where EXISTS" +
" (select o from in(c.orders) o)";
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
CreditRating creditRating = CreditRating.GOOD;
int updateCount = em.createQuery(update).
setParameter(1, creditRating).executeUpdate();
em.getTransaction().rollback();
em.close();
}