New JPQL Reserved Identifiers

The JPQL grammar now knows the Jakarta Persistence 3.2 keywords ID, VERSION, FIRST, LAST, ON, NULLS, CAST, STRING, INTEGER, LONG, FLOAT, DOUBLE, TREAT, UNION, INTERSECT, EXCEPT, RIGHT and REPLACE (case-insensitive), as well as the || concatenation operator. In previous releases these words could be used as identification variables and result aliases, for example SELECT e.id AS id FROM E e ORDER BY id or SELECT first FROM Foo first. Such queries are now rejected with a parse error, as required by section 4.4.1 of the specification.

With the exception of INTEGER, LONG, FLOAT and DOUBLE the new keywords may still be used as path components, so attributes named id, version, first or replace can still be navigated (o.version). Attributes named integer, long, float or double can no longer be referenced in a JPQL path expression; rename them or access them through the Criteria API or native SQL. Rename identification variables and aliases that collide with the new keywords (most commonly id, version, first, last and on). There is no soft-keyword mode and no compatibility option.