2.10.2.11. JPQL Null Values
When the target of a reference does not exist in the database, its value is regarded as NULL.
SQL 92 NULL semantics defines the evaluation of conditional expressions containing NULL values.
The following is a brief description of these semantics:
-
Comparison or arithmetic operations with a
NULLvalue always yield an unknown value. -
Two
NULLvalues are not considered to be equal, the comparison yields an unknown value. -
Comparison or arithmetic operations with an unknown value always yield an unknown value.
-
The
IS NULLandIS NOT NULLoperators convert aNULLstate-field or single-valued association-field value into the respectiveTRUEorFALSEvalue.
Note: The JPQL defines the empty string, "", as a string with 0 length, which is not equal to a NULL value.
However, NULL values and empty strings may not always be distinguished when queries are mapped to some databases.
Application developers should therefore not rely on the semantics of query comparisons involving the empty string and NULL value.