2.10.2.5.1. JPQL Literals
A string literal is enclosed in single quotes—for example: 'literal'. A string literal that includes a single quote is represented by two single quotes—for example: 'literal''s'. String literals in queries, like Java String literals, use unicode character encoding. The use of Java escape notation is not supported in query string literals.
Exact numeric literals support the use of Java integer literal syntax as well as SQL exact numeric literal syntax.
Approximate literals support the use of Java floating point literal syntax as well as SQL approximate numeric literal syntax.
Enum literals support the use of Java enum literal syntax. The enum class name must be specified.
Appropriate suffixes can be used to indicate the specific type of a numeric literal in accordance with the Java Language Specification.
The boolean literals are TRUE and FALSE.
Although predefined reserved literals appear in upper case, they are case insensitive.
The JDBC escape syntax may be used for the specification of date, time, and timestamp literals. For example:
SELECT o
FROM Customer c JOIN c.orders o
WHERE c.name = 'Smith'
AND o.submissionDate {d '2008-12-31'}
Date, time, and timestamp literals are passed as is to the JDBC driver in use.
Entity type literals are specified by entity names—for example: Customer.
Although reserved literals appear in upper case, they are case insensitive.