throw new RuntimeException("Неизвестный тип выборщика: " + indefiner.getId());
}
}
public AbstractTablesSelector<?> createTableSelector(EntityManager manager, Lpu lpu, AbstractReportTable table, int tableId, DateRange range){
AbstractTablesSelector selector;
if (table instanceof DiseaseTable){
switch (table.getType().getId()){
case DiseaseReportMaps.SELECTOR_ID_DISEATED_REPORT:
case DiseaseReportMaps.SELECTOR_ID_SICKLIST_REPORT:
case DiseaseReportMaps.SELECTOR_ID_FOLLUP_REPORT:
case DiseaseReportMaps.SELECTOR_ID_FORM_8_TABLE_1001:
selector = new DiseaseTableSellector((DiseaseTable) table, manager, tableId);
break;
case DiseaseReportMaps.SELECTOR_ID_COMBINED_DISEASE_TABLE:
selector = new CombinedDiseaseTableSelector((CombinedDiseaseTable) table, manager, tableId);
break;
default:
throw new RuntimeException("Неизвестный тип таблицы");
}
}
else if (table instanceof TableOfTable){
selector = new TableOfTableSelector((TableOfTable)table, manager, tableId);
}
else{
throw new RuntimeException("Неизвестный тип таблицы");
}
selector.setRange(range);
selector.setLpu(lpu);
return selector;
}