You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Mike Kienenberger (JIRA)" <ji...@apache.org> on 2006/04/18 17:10:46 UTC

[JIRA] Created: (CAY-514) implement a "MATCH ALL VALUES" expression

implement a "MATCH ALL VALUES" expression
-----------------------------------------

         Key: CAY-514
         URL: http://issues.apache.org/cayenne/browse/CAY-514
     Project: Cayenne
        Type: New Feature

  Components: Cayenne Core Library  
    Versions: AFTER 1.2    
    Reporter: Mike Kienenberger
     Fix For: AFTER 1.2


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


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/cayenne/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira