Iterator iter = siglaCurricularCourses.iterator(); while (iter.hasNext()) { Curr_licenciatura siglaCurricularCourse = (Curr_licenciatura) iter.next(); if (siglaCurricularCourse.getObjectivos() != null && siglaCurricularCourse.getObjectivos().length() >= objectivosGerais.length()) { objectivosGerais = siglaCurricularCourse.getObjectivos();
Query query = new QueryByCriteria(Curr_licenciatura.class, crit); Curr_licenciatura curr_licenciatura = (Curr_licenciatura) broker.getObjectByQuery(query); Criteria critEn = new Criteria(); critEn.addEqualTo( "codigo_disc", codeFixerFenixToSigla(fenixCurricularCourse.getCode()));  critEn.addEqualTo("ano_lectivo", "2002");         Query queryEn = new QueryByCriteria(Curr_lic_ingles.class, critEn); Curr_lic_ingles curr_lic_ingles = (Curr_lic_ingles) broker.getObjectByQuery(queryEn); if (curr_licenciatura == null) { System.out.println( "No encontrei nada no sigla para a disciplina curricular ->" + fenixCurricularCourse.getCode() + "-" + fenixCurricularCourse.getName()); } else { Criteria crit1 = new Criteria(); crit1.addEqualTo( "keyCurricularCourse", fenixCurricularCourse.getIdInternal()); Query query1 = new QueryByCriteria(Curriculum.class, crit1); ICurriculum curriculum = (ICurriculum) broker.getObjectByQuery(query1); if (curriculum == null) { insertCurriculum( broker, fenixCurricularCourse, curr_licenciatura, curr_lic_ingles); } else { updateCurriculum( broker, fenixCurricularCourse, curr_licenciatura, curr_lic_ingles, curriculum); }
	private ICurriculum updateCurriculum(		ICurriculum curriculum,		List siglaCurricularCourses,		PersistenceBroker broker) {		String objectivosOP = "";		String objectivosGerais = "";		String programa = "";		Iterator iter = siglaCurricularCourses.iterator();		while (iter.hasNext()) {			Curr_licenciatura siglaCurricularCourse =				(Curr_licenciatura) iter.next();			if (siglaCurricularCourse.getObjectivos() != null				&& siglaCurricularCourse.getObjectivos().length()					>= objectivosGerais.length()) {				objectivosGerais = siglaCurricularCourse.getObjectivos();			}			if (siglaCurricularCourse.getObjectivos_op() != null				&& siglaCurricularCourse.getObjectivos_op().length()					>= objectivosOP.length()) {				objectivosOP = siglaCurricularCourse.getObjectivos_op();			}			if (siglaCurricularCourse.getProgr_res() != null				&& siglaCurricularCourse.getProgr_res().length()					>= programa.length()) {				programa = siglaCurricularCourse.getProgr_res();			}		}		if (curriculum.getGeneralObjectives() == null			|| curriculum.getGeneralObjectives().length()				< objectivosGerais.length()) {			curriculum.setGeneralObjectives(objectivosGerais);		}		if (curriculum.getOperacionalObjectives() == null			|| curriculum.getOperacionalObjectives().length()				< objectivosOP.length()) {			curriculum.setOperacionalObjectives(objectivosOP);		}		if (curriculum.getProgram() == null			|| curriculum.getProgram().length() < programa.length()) {			curriculum.setProgram(programa);		}		return curriculum;	}