2.10.2.5.14. JPQL Empty Collection Comparison Expressions
The syntax for the use of the comparison operator IS EMPTY in an empty_collection_comparison_expression is as follows:
empty_collection_comparison_expression ::= collection_valued_path_expression IS [NOT] EMPTY
This expression tests whether or not the collection designated by the collection-valued path expression is empty (i.e. has no elements).
For example, the following query will return all magazines that don’t have any articles at all:
SELECT mag FROM Magazine mag WHERE mag.articles IS EMPTY
If the value of the collection-valued path expression in an empty collection comparison expression is unknown, the value of the empty comparison expression is unknown.