CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<EntityWithBooleanField> cq = cb.createQuery(EntityWithBooleanField.class);
Root<EntityWithBooleanField> root = cq.from(EntityWithBooleanField.class);
cq.where(cb.equal(root.get(EntityWithBooleanField_.booleanValue), Boolean.TRUE));
TypedQuery<EntityWithBooleanField> query = em.createQuery(cq);
query.getResultList();
em.createQuery("select e from EntityWithBooleanField as e where e.booleanValue = :param", EntityWithBooleanField.class)
.setParameter("param", Boolean.TRUE)
.getResultList();
em.createQuery("SELECT e FROM EntityWithBooleanField e WHERE e.booleanValue = TRUE", EntityWithBooleanField.class)
.getResultList();