I'm using the Apache chemistry opencmis library to interact with Alfresco. To query documents there is a method called queryObjects, which takes in an OperationContext as an argument. On this context, I can set a boolean flag, called setLoadSecondaryTypeProperties. However, even if I set it to true, it won't return the secondary type properties. I can only reach those properties if i use a SELECT query and join the two "tables" together on cmisbjectId.
The problem is, that the select query doesn't return cmis Document types, it returns QueryResult types, and it can't be casted, and I really need the Document.
I have tested it ,you are right,it did not work.The only opiton you can choose is to use session.query which returns QueryResult. then you can iterate the query result and load the document one by one , or you can use session.queryObjects to batch query documents by uuids If you want to use aspect properties ,you can get from QueryResult
Thanks for your help! Currently I use session.query, then iterate over the result. Didn't wanted to use this method as I have to make severaly trips to the repository, but i have to, as I need to query these result by a secondary type property.