The Java EE 5 Tutorial

The IS NULL Expression

 FROM Team t
 WHERE t.league IS NULL

Data retrieved: All teams not associated with a league.

Description: The IS NULL expression can be used to check if a relationship has been set between two entities. In this case, the query checks to see if the teams are associated with any leagues, and returns the teams that do not have a league.

See also: NULL Comparison Expressions, NULL Values