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

Multiple inExp are grouped into one in()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      If I were to write in sql
      Select * from test where a in (1,2,3) and a in (1,2)

      I’d only get rows where a is 1 or 2.

      If you do similar with cayenne expressions

      Expression exp = ExpressionFactory.inExp(COLUMN_A,

      {set with 1,2,3}

      )
      .andExp(ExpressionFactory.inExp(COLUMN_A,

      {set with 1,2}

      );

      Then cayenne will turn that into a sql statement like
      Select * from test where a in (1,2,3);

      Is this expected behaviour?
      To work more like SQL it would be better if there were 2 in statements or if it could be optimised to be in (1,2)

      Attachments

        Activity

          People

            Unassigned Unassigned
            colling2 Graham Collinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: