OCQuery query = instance.newQuery("SELECT Doc.Ref FROM Document." + managerName + " AS Doc WHERE Doc.Number = &NUM_A");
query.setParameter("NUM_A", new OCVariant(number));
OCQueryResult result = query.execute();
OCQueryResultSelection selection = result.choose();
int selectionSZ = selection.size();
List<OCDocumentRef> refList = new ArrayList<OCDocumentRef>(selectionSZ);
while (selection.next()) {
refList.add(new OCDocumentRef(selection.getObject(0)));
}
return refList.toArray(new OCDocumentRef[selectionSZ]);
}