IProfessorship professorship = new Professorship(); persistentProfessorship.simpleLockWrite(professorship);  professorship.setTeacher(iTeacher); professorship.setExecutionCourse(iExecutionCourse);
Professorship.create(false, iExecutionCourse, iTeacher, null);
    public boolean run(Integer infoExecutionCourseCode, Integer teacherNumber)            throws FenixServiceException {        try {            ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();            IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher();            IPersistentProfessorship persistentProfessorship = sp.getIPersistentProfessorship();            IPersistentExecutionCourse persistentExecutionCourse = sp.getIPersistentExecutionCourse();            ITeacher iTeacher = persistentTeacher.readByNumber(teacherNumber);            if (iTeacher == null) {                throw new InvalidArgumentsServiceException();            }            IExecutionCourse iExecutionCourse = (IExecutionCourse) persistentExecutionCourse.readByOID(                    ExecutionCourse.class, infoExecutionCourseCode);            if (lectures(iTeacher, iExecutionCourse.getProfessorships())) {                throw new ExistingServiceException();            }            IProfessorship professorship = new Professorship();            persistentProfessorship.simpleLockWrite(professorship);            professorship.setTeacher(iTeacher);            professorship.setExecutionCourse(iExecutionCourse);        } catch (ExistingPersistentException ex) {            throw new ExistingServiceException(ex);        } catch (ExcepcaoPersistencia ex) {            throw new FenixServiceException(ex);        }        return true;    }