Consider the two entities:
The JPQL-query "from Parent p where p.child is null" should list all parents that don't have a child.
The actual SQL that is generated looks like this:
This query always returns an empty result, because the pk of person is never null!
Btw, here is another strong argument which indicates that "bug" is the correct term:
If you use the query
you get the following SQL statement:
This returns all persons instead of just those with children.
Thanks for creating the report, but please stop arguing whether it's a bug or not. It's not clear from the spec and since we don't have an implementation of this to check against the TCK, we don't know if this is a valid interpretation. The behavior for "owned" associations you are referring is apparently valid, otherwise Hibernate wouldn't be JPA compliant. For non-owned assocations, we don't know yet. So, provide the PR, and then we can talk about details
I am sorry. I don't actually care whether you call this a bug, an enhancement or an improvement. I just wanted to point out that unlike the original query, which does not make sense if you regard the where clause as an implicit and therefor inner join, the query using `is not null` would work perfectly fine if an inner join was generated. So the argument against the validity of the original where clause does not hold in case of this modified where clause, because the path p.child is not null.
Also in case of `is not null` EclipseLinks Query is actually correct, so my previous statement that EclipseLink and Hibernate are either both correct or incorrect is not true for this modified query.