AnsweredAssumed Answered

Multiple Where Clause Predicates on Attributes w/ Multiple Values

Question asked by arbitraryname on Jul 15, 2015
Latest reply on Jul 23, 2015 by arbitraryname
Hi Everyone,

I have a query I am trying to execute via CMIS, which queries on a attribute with multiple values.

My query is like this so far (note we alias aspects as their name to ease the generation of queries in code)


SELECT *


FROM namespace:type AS primary JOIN namespace:aspectA AS P:namespace:aspectA ON primary.cmis:objectId=P:namespace:aspectA.cmis:objectId

WHERE

'myValue' = ANY P:namespace:aspectA.namespace:RepeatingAttribute


Which is working great.

But when I try to add ANDs and ORs everything breaks down.

I know one code has 2 of my values but this does not work and returns no results and no errors. Just 0 results


SELECT *


FROM namespace:type AS primary JOIN namespace:aspectA AS P:namespace:aspectA ON primary.cmis:objectId=P:namespace:aspectA.cmis:objectId

WHERE

'myValue' = ANY P:namespace:aspectA.namespace:RepeatingAttribute

AND


'myValue2' = ANY P:namespace:aspectA.namespace:RepeatingAttribute



When I run that same query but with an OR as the logic between my predicates, I get 15 results. However, if I query on myValue I get 1, and myValue2 returns 19. I have no idea what the intersection/distinctness could be doing to create that set of 15.

Is this just not supported? What is the logic here? And can I work around this at all?

FYI I am issuing these with CMIS WorkBench, and our code is using Apache Chemistry as well.

Outcomes