ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport(); IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher(); IPersistentExecutionCourse persistentExecutionCourse = sp.getIPersistentExecutionCourse();
final ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();
    public void run(InfoProfessorship infoProfessorShip, Boolean responsibleFor)            throws FenixServiceException, ExcepcaoPersistencia {        ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher();        IPersistentExecutionCourse persistentExecutionCourse = sp.getIPersistentExecutionCourse();                Integer executionCourseId = infoProfessorShip.getInfoExecutionCourse().getIdInternal();                IExecutionCourse executionCourse = (IExecutionCourse) persistentExecutionCourse.readByOID(                ExecutionCourse.class, executionCourseId);        if (executionCourse == null) {            throw new NonExistingServiceException("message.nonExisting.executionCourse", null);        }        Integer teacherNumber = infoProfessorShip.getInfoTeacher().getTeacherNumber();                ITeacher teacher = persistentTeacher.readByNumber(teacherNumber);        if (teacher == null) {            throw new NonExistingServiceException("message.non.existing.teacher", null);        }        Professorship.create(responsibleFor, executionCourse, teacher, infoProfessorShip.getHours());    }