IEnrolment enrolment = (IEnrolment) enrolmentsInOtherStudentCurricularPlans.get(i);
IEnrollment enrolment = (IEnrollment) enrolmentsInOtherStudentCurricularPlans.get(i);
    public int countCompletedCoursesForStudentForActiveUndergraduateCurricularPlan(            IStudent student) throws ExcepcaoPersistencia {        Criteria criteria = new Criteria();        criteria.addEqualTo("studentCurricularPlan.student.idInternal",                student.getIdInternal());        criteria.addEqualTo("studentCurricularPlan.currentState",                StudentCurricularPlanState.ACTIVE_OBJ);        criteria.addEqualTo("studentCurricularPlan.degreeCurricularPlan.degree.tipoCurso",                TipoCurso.LICENCIATURA_OBJ);        criteria.addEqualTo("enrolmentState", EnrolmentState.APROVED);        int numberCompletedCourses = count(Enrolment.class, criteria);        IStudentCurricularPlan studentCurricularPlan =            	getStudentsActiveUndergraduateCurricularPlan(student);        if ((studentCurricularPlan != null)                && !(studentCurricularPlan.getDegreeCurricularPlan().getDegree()                        .getSigla().equals("LEEC"))) {            criteria = new Criteria();            criteria.addEqualTo("studentCurricularPlan.student.idInternal",                    student.getIdInternal());            criteria.addNotEqualTo("studentCurricularPlan.currentState",                    StudentCurricularPlanState.ACTIVE_OBJ);            criteria.addEqualTo("studentCurricularPlan.degreeCurricularPlan.degree.tipoCurso",                    TipoCurso.LICENCIATURA_OBJ);            criteria.addEqualTo("enrolmentState", EnrolmentState.APROVED);            List enrolmentsInOtherStudentCurricularPlans = queryList(Enrolment.class, criteria);            for (int i = 0; i < enrolmentsInOtherStudentCurricularPlans.size(); i++) {                IEnrolment enrolment = (IEnrolment) enrolmentsInOtherStudentCurricularPlans.get(i);                criteria = new Criteria();                criteria.addEqualTo("equivalentEnrolment.idInternal", enrolment.getIdInternal());                int numberOfEquivilantEnrolments = count(EquivalentEnrolmentForEnrolmentEquivalence.class, criteria);                if (numberOfEquivilantEnrolments == 0)                {                    numberCompletedCourses++;                }            }        }        return numberCompletedCourses;    }