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. unit-test-java-snippet.txt
        0.9 kB
        Andrew Lindesay
      2. 0001-CAY-1426.patch
        2 kB
        Andrus Adamchik
      3. CAY-1426.-Fixed-incorrect-parsing-of-LIKE-ESCAPE-with-input-parameter.patch
        3 kB
        Ksenia Khailenko

        Activity

        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development