Grokbase Groups Cayenne dev May 2008
FAQ
[ https://issues.apache.org/cayenne/browse/CAY-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik closed CAY-514.
-------------------------------

Resolution: Fixed

Fixed. Reintroduced split pipe syntax in ExpressionFactory. E.g.:

Expression e = ExpressionFactory.matchAllExp( "|exhibitArray.artistExhibitArray.toArtist", picasso, dali);

This generates a bunch of split joins:

SELECT DISTINCT t0.GALLERY_ID, t0.GALLERY_NAME
FROM GALLERY t0
JOIN EXHIBIT t1 ON (t0.GALLERY_ID = t1.GALLERY_ID)
JOIN ARTIST_EXHIBIT t2 ON (t1.EXHIBIT_ID = t2.EXHIBIT_ID)
JOIN EXHIBIT t3 ON (t0.GALLERY_ID = t3.GALLERY_ID)
JOIN ARTIST_EXHIBIT t4 ON (t3.EXHIBIT_ID = t4.EXHIBIT_ID)
WHERE (t2.ARTIST_ID = ?) AND (t4.ARTIST_ID = ?)

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

Key: CAY-514
URL: https://issues.apache.org/cayenne/browse/CAY-514
Project: Cayenne
Issue Type: New Feature
Components: Cayenne Core Library
Affects Versions: 3.0
Reporter: Mike Kienenberger
Assignee: Mike Kienenberger
Fix For: 3.0


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.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedMay 6, '08 at 5:55p
activeMay 6, '08 at 5:55p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 1 post

People

Translate

site design / logo © 2021 Grokbase