Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2763

Certain AND/NOT combination fail to parse

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.4.2
    • None
    • kernel
    • None

    Description

      I don't have enough details for a minimized use case, I'll update this as I investigate.
      The following query fails to parse, campaign is a reference field, and enabled is a boolean field.

      update E_CampaignDevice cd set cd.enabled = true where  ( cd.campaign = :campaign ) AND (  NOT ( cd.enabled )  )
      

      I don't see anything wrong with the query. The error is:

      Caused by: <openjpa-2.4.2-xl4.2-rUnversioned directory nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Encountered "NOT" at character 92, but expected: ["("].
              at org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:13188)
              at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:13064)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_primary(JPQL.java:1980)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_factor(JPQL.java:1958)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(JPQL.java:1807)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_expression(JPQL.java:1769)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_primary(JPQL.java:1975)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_factor(JPQL.java:1958)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(JPQL.java:1807)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(JPQL.java:1820)
              at org.apache.openjpa.kernel.jpql.JPQL.conditional_expression(JPQL.java:1769)
              at org.apache.openjpa.kernel.jpql.JPQL.where_clause(JPQL.java:1587)
              at org.apache.openjpa.kernel.jpql.JPQL.update_statement(JPQL.java:151)
              at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:66)
              at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:2428)
              at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:2415)
              at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:48)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            pveselov Pawel Veselov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: