// FIXME does this code handles pagination?
List<CmisObject> resultObjects = new ArrayList<CmisObject>();
Iterator<QueryResult> results = session.query(query, false).iterator();
int index = 0;
while (results.hasNext() && index < max) {
QueryResult result = results.next();
String id = result.getPropertyValueById(CMISProperty.ID.getName());
resultObjects.add(session.getObject(CMISObjectId.getObjectId(id)));
index++;
}
return resultObjects;
}