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

Oracle: Problem with ExpressionFactory.notInExp()

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.2, 4.0.RC1, 4.1.M2
    • 3.1.4, 4.0, 4.1.B1
    • Core Library
    • None

    Description

      When collection in notInExp() contains more than 1000 items, the ExpressionException is thrown:

      org.apache.cayenne.exp.ExpressionException: [v.3.1.2 Nov 13 2017 07:52:36] Or: invalid parent - Negate
      at org.apache.cayenne.exp.parser.AggregateConditionNode.jjtSetParent(AggregateConditionNode.java:80)
      at org.apache.cayenne.exp.parser.SimpleNode.connectChildren(SimpleNode.java:324)
      ...

      Code to reproduce the problem

      SelectQuery query = new SelectQuery(Artist.class);
      List<Integer> excluded = new ArrayList<Integer>();
      for (int i = 0; i < 1001; ++i) {
       excluded.add(i);
      }
      query.andQualifier(ExpressionFactory.notInExp(Artist.ID_PK_COLUMN, excluded));
      getContext().performQuery(query); 

       

      Attachments

        1. stacktrace.txt
          3 kB
          Vladimir Zhilin

        Issue Links

          Activity

            Thanks for the report!

            ntimofeev Nikita Timofeev added a comment - Thanks for the report!

            Simple workaround: ExpressionFactory.inExp(Artist.ID_PK_COLUMN, excluded).notExp()

            ntimofeev Nikita Timofeev added a comment - Simple workaround: ExpressionFactory.inExp(Artist.ID_PK_COLUMN, excluded).notExp()
            ntimofeev Nikita Timofeev added a comment - Fixed 3.1 : https://github.com/apache/cayenne/commit/6ca590d9e9ebc7877934652b2b59c1e171d1f9c1 4.0 : https://github.com/apache/cayenne/commit/fed071c16ec3ed907112ce9e556b5ca66fd4f11b 4.1 : https://github.com/apache/cayenne/commit/9b4f9e5eef5877ad8b16fdd04ea0d2b288c38a3e  

            People

              ntimofeev Nikita Timofeev
              vzhilin Vladimir Zhilin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: