if (!infoCandidacy.getInfoSeminary().getHasThemes().booleanValue()) { ((Candidacy) candidacy).setThemeIdInternal(null); candidacy.setTheme(null); }
    public void run(InfoCandidacy infoCandidacy) throws BDException {        try {            ISuportePersistente persistenceSupport = SuportePersistenteOJB.getInstance();            IPersistentSeminaryCandidacy persistentCandidacy = persistenceSupport                    .getIPersistentSeminaryCandidacy();            IPersistentSeminaryModality persistentModality = persistenceSupport                    .getIPersistentSeminaryModality();            IPersistentSeminaryCaseStudyChoice persistentChoice = persistenceSupport                    .getIPersistentSeminaryCaseStudyChoice();            IPersistentStudent persistentStudent = persistenceSupport.getIPersistentStudent();            IPersistentSeminary persistentSeminary = persistenceSupport.getIPersistentSeminary();            IPersistentCurricularCourse persistentCurricularCourse = persistenceSupport                    .getIPersistentCurricularCourse();            IPersistentSeminaryTheme persistentTheme = persistenceSupport.getIPersistentSeminaryTheme();            ICandidacy candidacy = Cloner.copyInfoCandicacy2ICandidacy(infoCandidacy);            IStudent readStudent = (IStudent) persistentStudent.readByOID(Student.class, candidacy                    .getStudent().getIdInternal());            ISeminary readSeminary = (ISeminary) persistentSeminary.readByOID(Seminary.class, candidacy                    .getSeminary().getIdInternal());            ICurricularCourse readCurricularCourse = (ICurricularCourse) persistentCurricularCourse                    .readByOID(CurricularCourse.class, candidacy.getCurricularCourse().getIdInternal());            IModality modality = persistentModality.readByName("Completa");            persistentCandidacy.simpleLockWrite(candidacy);            candidacy.setModality(modality);            candidacy.setStudent(readStudent);            candidacy.setSeminary(readSeminary);            candidacy.setCurricularCourse(readCurricularCourse);            if (modality.getIdInternal().equals(infoCandidacy.getInfoModality().getIdInternal())) {                ((Candidacy) candidacy).setThemeIdInternal(null);                candidacy.setTheme(null);            } else {                ITheme readTheme = (ITheme) persistentTheme.readByOID(Dominio.Seminaries.Theme.class,                        candidacy.getTheme().getIdInternal());                candidacy.setTheme(readTheme);            }            for (Iterator iter = candidacy.getCaseStudyChoices().iterator(); iter.hasNext();) {                ICaseStudyChoice element = (ICaseStudyChoice) iter.next();                persistentChoice.simpleLockWrite(element);                element.setCandidacy(candidacy);            }        } catch (ExcepcaoPersistencia ex) {            throw new BDException("Got an error while trying to write a candidacy to the database", ex);        }    }