The workaround is actually very simple, and more expressive too:
List<Parent> parents = entityManager.createQuery(
"select p " +
"from Parent p " +
"left join p.child c " +
"where c is null", Parent.class)
.getResultList();
Now, the problem with implicit joins is they imply an INNER JOIN, not a LEFT JOIN. I also checked the JPA spec and there was nothing there saying this use case should be supported. Steve Ebersole Do you want to have this p.child is null being translated to a LEFT JOIN with an IS NULL check in 6.0? |