cancel
Showing results for 
Search instead for 
Did you mean: 

query by jointing multiple aspects

nick_l
Champ in-the-making
Champ in-the-making
I have a situation which requires query over multiple aspects. I can find examples which join cmis:document and cm:some_aspects, such as

"select t.*, d.* from cmis:document as d join cm:author as t on d.cmisSmiley Surprisedbjectid = t.cmisSmiley Surprisedbjectid where t.cm:author='ianrankin' "

The question is how to join multiple aspects? Where can I find the specifications?

Thanks.
3 REPLIES 3

ecarbenay
Star Contributor
Star Contributor
You can join multiple aspects like this :

select t.*, d.*, e.* from cmis:document as d
  join cm:author as t on d.cmisSmiley SurprisedbjectId = t.cmisSmiley SurprisedbjectId
  join exif:exif e on d.cmisSmiley SurprisedbjectId = e.cmisSmiley SurprisedbjectId
where t.cm:author='Emmanuel Carbenay'
  and e.exif:manufacturer = 'Canon'

Simply chain your JOIN predicates

Emmanuel

nick_l
Champ in-the-making
Champ in-the-making
Hi Emmanuel,

That's exactly what I tried before I posted this question. But I got exception as below:

org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: No selector for
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:423)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:570)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(DiscoveryServiceImpl.java:142)
   at au.com.SearchService.searchDocsFromRepository(SearchService.java:132)

nick_l
Champ in-the-making
Champ in-the-making
rechecking my code and found I made a simple mistake. the join works fine, but when I compose the where condition, I forget to use the alias.

So problem solved. Smiley Happy