JPQL Integer Literals are typed Integer

Previous releases always created JPQL integer literals as java.lang.Long, so SELECT 1 FROM …​ or e.intField + 1 produced Long results. As required by section 4.8.5 of the specification, an integer literal without an l/L suffix that fits into the int range is now a java.lang.Integer; arithmetic on Byte, Short and Integer operands is promoted to Integer (also in the Criteria API).

Application code that casts such results to Long must be adapted to Integer or Number, or use an explicit 1L literal. No compatibility option exists.