Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.M1
-
None
-
None
Description
A problem exists where if an integral literal is supplied in an EJBQL expression where the string cannot be represented in a (32bit) integer, it does not attempt to instead use a (64bit) long and raises the following error;
Caused by: org.apache.cayenne.ejbql.EJBQLException: [v.3.2.M2-SNAPSHOT May 14 2014 23:02:59] Invalid integer: 744073709551615 at org.apache.cayenne.access.translator.ejbql.EJBQLConditionTranslator.visitIntegerLiteral(EJBQLConditionTranslator.java:679) at org.apache.cayenne.ejbql.parser.EJBQLIntegerLiteral.visitNode(EJBQLIntegerLiteral.java:34) at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59) at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83) at org.apache.cayenne.ejbql.parser.EJBQLGreaterThan.visitChild(EJBQLGreaterThan.java:39) at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
This patch maintains existing behaviour for literals that can be expressed as integers (INTEGER), but will instead use longs (BIGINT) for cases where the number is not able to be expressed as an integer.