ITeacher teacher = (ITeacher) teacherDAO.readByOID(Teacher.class, infoTeacher .getIdInternal()); InfoTeacher infoTeacher2 = Cloner.copyITeacher2InfoTeacher(teacher);
ITeacher teacher = (ITeacher) teacherDAO.readByOID(Teacher.class, infoTeacher.getIdInternal()); InfoTeacher infoTeacher2 = InfoTeacherWithPersonAndCategory.newInfoFromDomain(teacher);
    public TeacherInstitutionWorkingTimeDTO run(InfoTeacher infoTeacher, Integer executionPeriodId)            throws FenixServiceException {        TeacherInstitutionWorkingTimeDTO teacherInstitutionWorkingTimeDTO = new TeacherInstitutionWorkingTimeDTO();        try {            ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();            IPersistentTeacherInstitutionWorkingTime teacherInstitutionWorkingTimeDAO = sp                    .getIPersistentTeacherInstitutionWorkingTime();            IPersistentExecutionPeriod executionPeriodDAO = sp.getIPersistentExecutionPeriod();            IPersistentTeacher teacherDAO = sp.getIPersistentTeacher();            ITeacher teacher = (ITeacher) teacherDAO.readByOID(Teacher.class, infoTeacher                    .getIdInternal());            InfoTeacher infoTeacher2 = Cloner.copyITeacher2InfoTeacher(teacher);            IExecutionPeriod executionPeriod = null;            if ((executionPeriodId == null) || (executionPeriodId.intValue() == 0)) {                executionPeriod = executionPeriodDAO.readActualExecutionPeriod();            } else {                executionPeriod = (IExecutionPeriod) executionPeriodDAO.readByOID(ExecutionPeriod.class,                        executionPeriodId);            }            InfoExecutionPeriod infoExecutionPeriod = InfoExecutionPeriod.newInfoFromDomain(executionPeriod);            List teacherInstitutionWorkTimeList = teacherInstitutionWorkingTimeDAO                    .readByTeacherAndExecutionPeriod(teacher, executionPeriod);            List infoTeacherInstitutionWorkTimeList = (List) CollectionUtils.collect(                    teacherInstitutionWorkTimeList, new Transformer() {                        public Object transform(Object input) {                            ITeacherInstitutionWorkTime teacherInstitutionWorkTime = (ITeacherInstitutionWorkTime) input;                            InfoTeacherInstitutionWorkTime infoTeacherInstitutionWorkTime = Cloner                                    .copyITeacherInstitutionWorkingTime2InfoTeacherInstitutionWorkTime(teacherInstitutionWorkTime);                            return infoTeacherInstitutionWorkTime;                        }                    });            teacherInstitutionWorkingTimeDTO.setInfoExecutionPeriod(infoExecutionPeriod);            teacherInstitutionWorkingTimeDTO.setInfoTeacher(infoTeacher2);            teacherInstitutionWorkingTimeDTO                    .setInfoTeacherInstitutionWorkTimeList(infoTeacherInstitutionWorkTimeList);        } catch (ExcepcaoPersistencia e) {            throw new FenixServiceException("Problems on database!", e);        }        return teacherInstitutionWorkingTimeDTO;    }