final IModality modality = persistentModality.readByName("Completa");
final IModality modality = (IModality) persistentModality.readByOID(Modality.class,infoCandidacy.getInfoModality().getIdInternal());
    public void run(InfoCandidacy infoCandidacy) throws ExcepcaoPersistencia {        final ISuportePersistente persistenceSupport = PersistenceSupportFactory.getDefaultPersistenceSupport();        ICandidacy candidacy = DomainFactory.makeCandidacy();        candidacy.setApproved(infoCandidacy.getApproved());        candidacy.setMotivation(infoCandidacy.getMotivation());                // Modality        final IPersistentSeminaryModality persistentModality = persistenceSupport.getIPersistentSeminaryModality();        final IModality modality = persistentModality.readByName("Completa");        candidacy.setModality(modality);        // Student        final IPersistentStudent persistentStudent = persistenceSupport.getIPersistentStudent();        final IStudent readStudent = (IStudent) persistentStudent.readByOID(Student.class, infoCandidacy.getInfoStudent().getIdInternal());        candidacy.setStudent(readStudent);        // Seminary        final IPersistentSeminary persistentSeminary = persistenceSupport.getIPersistentSeminary();        final ISeminary readSeminary = (ISeminary) persistentSeminary.readByOID(Seminary.class, infoCandidacy.getInfoSeminary().getIdInternal());        candidacy.setSeminary(readSeminary);                // Curricular Course        final IPersistentCurricularCourse persistentCurricularCourse = persistenceSupport.getIPersistentCurricularCourse();        final ICurricularCourse readCurricularCourse = (ICurricularCourse) persistentCurricularCourse.readByOID(CurricularCourse.class, infoCandidacy.getCurricularCourse().getIdInternal());        candidacy.setCurricularCourse(readCurricularCourse);        // Theme        if (modality.getIdInternal().equals(infoCandidacy.getInfoModality().getIdInternal())) {            candidacy.setTheme(null);        } else {            final IPersistentSeminaryTheme persistentTheme = persistenceSupport.getIPersistentSeminaryTheme();            final ITheme readTheme = (ITheme) persistentTheme.readByOID(Theme.class, infoCandidacy.getTheme().getIdInternal());            candidacy.setTheme(readTheme);        }        if (!infoCandidacy.getInfoSeminary().getHasThemes().booleanValue()) {            candidacy.setTheme(null);        }        // Seminary Case Study Choices        final IPersistentSeminaryCaseStudy persistentSeminaryCaseStudy = persistenceSupport.getIPersistentSeminaryCaseStudy();        for (InfoCaseStudyChoice infoCaseStudyChoice : (List<InfoCaseStudyChoice>) infoCandidacy.getCaseStudyChoices()) {            final ICaseStudyChoice caseStudyChoice = DomainFactory.makeCaseStudyChoice();                        caseStudyChoice.setOrder(infoCaseStudyChoice.getOrder());            final ICaseStudy caseStudy = (ICaseStudy) persistentSeminaryCaseStudy.readByOID(CaseStudy.class, infoCaseStudyChoice.getCaseStudy().getIdInternal());            caseStudyChoice.setCaseStudy(caseStudy);            caseStudyChoice.setCandidacy(candidacy);            candidacy.addCaseStudyChoices(caseStudyChoice);        }    }