String dql = "Select child.r_object_id as object_id from dm_sysobject (all) child, dm_relation relation where " +
"((child.i_chronicle_id = relation.child_id and any child.r_version_label = relation.child_label) " +
"or (child.r_object_id = relation.child_id and relation.child_label is nullstring)) " +
"and relation.relation_name='DM_ANNOTATE' and relation.parent_id= '" + doc.getObjectId().toString() + "'" ;IDfQuery query = sMgr.getQuery();
query.setDQL(dql);
col = query.execute(session, IDfQuery.DF_READ_QUERY);
while (col.next()) {
IDfTypedObject object = col.getTypedObject();
IDfNote note = (IDfNote) session.getObject(object.getId("object_id"));
log("\tnote: " + note.getObjectId().toString() + ", with name: " + note.getObjectName());
}
col.close();