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

implement a "MATCH ALL VALUES" expression

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M4, 3.0
    • Core Library
    • None

    Description

      Implement a "Match all values" expression behavior (like previously discussed as hasAllOfExp or MatchAllValuesExpression on the mailing list in the past).

      For example,

      letters
      a
      b
      c

      digits
      1
      2
      3

      letters__digits
      a-1
      a-2
      a-3
      b-2
      c-3
      c-2

      find all 1s: a
      find all 2s: a, b, c
      find all 3s: a, c

      "Match all values" on (1, 2) would generate sql like the following and
      return "a"

      select l1.* from letters l1, letters_digits ld1, digits d1, letters
      l2, letters_digits ld1, digits d2 where

      d1.value = '1' and ld1.digit_id = d1.digit_id and ld1.letter_id = l1.letter_id
      and
      d2.value = '2' and ld2.digit_id = d2.digit_id and ld2.letter_id = l2.letter_id

      The current limitation is due to the fact that Cayenne qualifier translator removes "duplicate" joins.

      You'd have to introduce the "split" expression as discussed in the threads below. Maybe use a pipe symbol at a place in the path where a split should start, like "|r1" or "r1.r2.|r3"?? Second thing to change is QueryAsembler.dbRelationshipAdded(..) method that removes "duplicates" to support the splits.

      There are a few more things to take care of to fully support splits, so this is certainly not a trivial change.

      Relevent threads discussing the idea and issues in more details:

      http://www.objectstyle.org/cayenne/lists/cayenne-devel/2003/09/0096.html
      http://www.objectstyle.org/cayenne/lists/cayenne-devel/2003/10/0005.html

      Attachments

        Issue Links

          Activity

            People

              mkienenb Mike Kienenberger
              mkienenb Mike Kienenberger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: