list = findEntityList(DangerService.class, f);
}
if (!list.isEmpty()){
dangerService = (DangerService) list.get(0);//Должна быть одна и ниибёт
dangerService.setDescription(details.description);
Speciality spec = null;
if (details.specialityID != 0) {
spec = findEntity(Speciality.class, details.specialityID);
}
dangerService.setSpeciality(spec);
}
else {
dangerService = new DangerService();
dangerService.setDescription(details.description);
dangerService.setDanger(findEntity(Danger.class, details.dangerId));
dangerService.setService(findEntity(Service.class, details.serviceId));
Speciality spec = null;
if (details.specialityID != 0) {
spec = findEntity(Speciality.class, details.specialityID);
}
dangerService.setSpeciality(spec);
}