dql.append(" and (");
dql.append(whereClause);
dql.append(") ENABLE (return_top 1)");
query.setDQL(dql.toString());
ICollection collec = query.execute(sess, IQuery.EXECUTE_READ_QUERY);
try {
if (!collec.next()) {
// TODO: The query is in the logs, but no indication of which
// WHERE clause failed appears in the ConfigureResponse.
throw new RepositoryException("[additionalTooRestrictive] " + dql);
}
} finally {
if (collec.getState() != ICollection.DF_CLOSED_STATE) {
collec.close();
}
}
}