Cayenne
  1. Cayenne
  2. CAY-1426

EJBQL: ESCAPE fails after positional parameter

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0RC3
    • Fix Version/s: 3.0.1, 3.1M1
    • Component/s: Core Library
    • Labels:

      Description

      The EJBQL specification allows for an escape character to be supplied for the generated SQL. For example, the following would be valid;

      ...WHERE (((r.applicableTimestamp>=?1) AND (r.applicableTimestamp<?2)) AND (UPPER(r.message) LIKE ?3 ESCAPE '|')) ORDER...

      The EJBQL parser is presently failing;

      ... 70 more
      Caused by: org.apache.cayenne.ejbql.parser.ParseException: Encountered " "ESCAPE" "ESCAPE "" at line 1, column 130.
      Was expecting:
      ")" ...

      at org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)

      1. CAY-1426.-Fixed-incorrect-parsing-of-LIKE-ESCAPE-with-input-parameter.patch
        3 kB
        Ksenia Khailenko
      2. 0001-CAY-1426.patch
        2 kB
        Andrus Adamchik
      3. unit-test-java-snippet.txt
        0.9 kB
        Andrew Lindesay

        Activity

        Andrew Lindesay created issue -
        Hide
        Andrew Lindesay added a comment -

        Add this unit test into "DataContextEJBQLConditionsTest" and it should show the failure.

        Show
        Andrew Lindesay added a comment - Add this unit test into "DataContextEJBQLConditionsTest" and it should show the failure.
        Andrew Lindesay made changes -
        Field Original Value New Value
        Attachment unit-test-java-snippet.txt [ 12443953 ]
        Hide
        Andrus Adamchik added a comment -

        Simplifying a test patch (done against trunk - 3.1).... the problem seems to be ESCAPE following positional parameter.

        Show
        Andrus Adamchik added a comment - Simplifying a test patch (done against trunk - 3.1).... the problem seems to be ESCAPE following positional parameter.
        Andrus Adamchik made changes -
        Attachment 0001-CAY-1426.patch [ 12449219 ]
        Andrus Adamchik made changes -
        Summary Support for "ESCAPE" in EJBQL EJBQL: ESCAPE fails after positional parameter
        Andrus Adamchik made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Andrus Adamchik [ andrus ]
        Fix Version/s 3.0.1 [ 12314876 ]
        Fix Version/s 3.1M1 [ 12314299 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Andrew Lindesay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development