I'm trying to implement a "Match all values" expression behavior (like
previously discussed as hasAllOfExp or MatchAllValuesExpression on the
mailing list in the past). I'm guessing no one ever implemented a
However, I'm finding myself inadequate for the task.
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
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
d2.value = '2' and ld2.digit_id = d2.digit_id and ld2.letter_id = l2.letter_id
At least, that's my understanding of what would need to be done based
on previous postings.
My actual use case is something along the lines of "any number of
names" + "any number of phones" + "any number of emails" on a contact
record that has a many-to-many relationship with names and with phones
and with emails.
Anyone have any suggestions?
I'm about to give up and do it in-memory by searching for a single
name, and then doing an in-memory removal (from the list) of each
non-matching contact for each remaining name, phone, and email....