//check all other reports in fack of using removing one
Field[] f = new Field[]{new Field("id", entity.getId(), Field.OPERATOR_NOT_EQUAL)};
Iterator iterator = findEntityList(ReportgenQuery.class, f).iterator();
while (iterator.hasNext()) {
ReportgenQuery superReportQuery = (ReportgenQuery) iterator.next();
ReportQuery superReport = null;
try {
superReport = ReportFactory.fromString(superReportQuery.getId(),
superReportQuery.getQuery(), this);
} catch (ReportException ex) {
continue;
}
ItemSelectorEditable<QueryExecuterSub> usedSubreports = superReport.getSubReports();
for(int i=0; i<usedSubreports.size(); i++) {
QueryExecuterSub col = usedSubreports.get(i);
if(col.getReportId() == entity.getId()) {
throw new ClipsServerException("Отчет '" + col.getReportTitle()
+ "' не может быть удален, поскольку его использует отчет '"