Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1933

Problems in Evaluating EJBQL Statements with Integral Literals > Integer.MAX_VALUE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.M1
    • 4.0.M2
    • 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.

      Attachments

        1. CAY-1933_15may2014_long.patch
          5 kB
          Andrew Ponsonby Lindesay

        Activity

          People

            Unassigned Unassigned
            apl Andrew Ponsonby Lindesay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: