Thanks for the quick response. I was hoping to find an alfresco specific extension to cmis-sql that could help me in getting the job done. Join works when relating objects to their aspects but my current problem is that not all the aspects are applied to each object so I have to run several queries and then combine the results in java code to get a complete list of documents which match the user's search phrase.