Filtering For NULL-Values

Whenever a query is needed to find all objects with a specific attribute set to null , an equality operator ( == ) has to be used. The reserved keyword null has to be used inside the query.

The next example shows how to find all persons where no firstname is known:

Query query = pm.newQuery(Person.class, "firstName == null");