private void updateLaboratoryFields(Laboratory laboratory, LaboratoryDto laboratoryDto)
      throws DaoEntityNotFoundException {

    String compressedFields = laboratoryDto.getFormProfessorDto().getCompressedFields();
    String pnc = compressedFields.replaceAll("\\)", " ").replaceAll("\\(", " ").split(" ")[0];

    Hour from = hourDao.getHourByValue(laboratoryDto.getFrom());
    Hour to = hourDao.getHourByValue(laboratoryDto.getTo());
    Professor professor = professorDao.getProfessorByPnc(pnc);
    Room room = roomDao.getRoomByName(laboratoryDto.getRoom());
    Day day = dayDao.getDayByValue(laboratoryDto.getDay());
    Section section = sectionDao.getSectionByName(laboratoryDto.getSection());
    Group group = groupDao.getGroupByName(laboratoryDto.getGroup());
    Subgroup subgroup = subgroupDao.getSubgroupByName(laboratoryDto.getSubgroup());
    Year year = yearDao.getYearByValue(laboratoryDto.getYear());
    Semester semester = semesterDao.getSemesterByValue(laboratoryDto.getSemester());
    WeeklyOccurrence weeklyOccurrence =
        weeklyOccurrenceDao.getWeeklyOccurrenceByName(laboratoryDto.getWeeklyOccurrence());

    laboratory.setFrom(from);
    laboratory.setTo(to);
    laboratory.setProfessor(professor);
    laboratory.setRoom(room);
    laboratory.setDay(day);
    laboratory.setSection(section);
    laboratory.setGroup(group);
    laboratory.setSubgroup(subgroup);
    laboratory.setYear(year);
    laboratory.setSemester(semester);
    laboratory.setWeeklyOccurrence(weeklyOccurrence);
  }