Predicate p1 = e.get("salary").greaterThan(100);
Predicate p2 = e.get("rating").equal(5);
Predicate p3 = e.get("name").like("John");
Predicate w1 = p1.and(p2.or(p3));
Predicate w2 = (p1.and(p2)).or(p3);
QueryDefinition q1 = e.select(e).where(w1);
String jpql1 = qb.toJPQL(q1);
emf.createEntityManager().createDynamicQuery(q1).getResultList();
QueryDefinition q2 = e.select(e).where(w2);
String jpql2 = qb.toJPQL(q2);
System.err.println(jpql1);
System.err.println(jpql2);
assertNotEquals(jpql1, jpql2);
emf.createEntityManager().createDynamicQuery(q2).getResultList();