2.10.2.8.3. JPQL Null Values in the Query Result
If the result of a query corresponds to a association-field or state-field whose value is null, that null value is returned in the result of the query method.
The IS NOT NULL construct can be used to eliminate such null values from the result set of the query.
Note, however, that state-field types defined in terms of Java numeric primitive types cannot produce NULL values in the query result.
A query that returns such a state-field type as a result type must not return a null value.