.readByExecutionYearAndDegreeType(executionYear.getIdInternal(), DegreeType.MASTER_DEGREE);
.readByExecutionYearAndDegreeType(executionYear.getYear(), DegreeType.MASTER_DEGREE);
    public void run(Integer executionYearID) throws FenixServiceException {        StringBuffer outgoingSibsPaymentFile = new StringBuffer();        try {            ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();            IExecutionYear executionYear = (IExecutionYear) sp.getIPersistentExecutionYear().readByOID(                    ExecutionYear.class, executionYearID);            IPersistentStudentCurricularPlan studentCurricularPlanDAO = sp                    .getIStudentCurricularPlanPersistente();            IPersistentGratuitySituation gratuitySituationDAO = sp.getIPersistentGratuitySituation();            IPersistentInsuranceTransaction insuranceTransactionDAO = sp                    .getIPersistentInsuranceTransaction();            IInsuranceValue insuranceValue = sp.getIPersistentInsuranceValue().readByExecutionYear(                    executionYear.getIdInternal());            if (insuranceValue == null) {                throw new InsuranceNotDefinedServiceException("error.insurance.notDefinedForThisYear");            }            String shortYear = executionYear.getYear().split("/")[0].trim().substring(2);            // read master degree and specialization execution degrees            List executionDegreeList = sp.getIPersistentExecutionDegree()                    .readByExecutionYearAndDegreeType(executionYear.getIdInternal(), DegreeType.MASTER_DEGREE);            int totalLines = 0;            HashMap studentsWithInsuranceChecked = new HashMap();            // add file header            addHeader(outgoingSibsPaymentFile);            // add lines gratuity            for (Iterator iter = executionDegreeList.iterator(); iter.hasNext();) {                IExecutionDegree executionDegree = (IExecutionDegree) iter.next();                IDegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan();                List studentCurricularPlanList = studentCurricularPlanDAO                        .readByDegreeCurricularPlan(degreeCurricularPlan);                //add insurance lines                for (Iterator iterator = studentCurricularPlanList.iterator(); iterator.hasNext();) {                    IStudentCurricularPlan studentCurricularPlan = (IStudentCurricularPlan) iterator                            .next();                    IStudent student = studentCurricularPlan.getStudent();                    if (studentsWithInsuranceChecked.containsKey(student.getIdInternal())) {                        continue;                    }                    studentsWithInsuranceChecked.put(student.getIdInternal(), null);                    List insuranceTransactionList = insuranceTransactionDAO                            .readAllNonReimbursedByExecutionYearAndStudent(executionYear, student);                    if (insuranceTransactionList.size() == 0) {                        // the student hasn't payed the insurance for this year                        // yet                        addLine(outgoingSibsPaymentFile,                                SibsOutgoingPaymentFileConstants.LINE_REGISTER_TYPE,                                SibsOutgoingPaymentFileConstants.LINE_PROCESSING_CODE, shortYear,                                student.getNumber(), SibsPaymentCodeFactory.getCode(SibsPaymentType.INSURANCE) + "", null,                                insuranceValue.getEndDate(), insuranceValue.getAnnualValue(),                                insuranceValue.getAnnualValue());                        totalLines++;                    }                }                List gratuitySituationList = gratuitySituationDAO                        .readGratuitySituationsByDegreeCurricularPlan(degreeCurricularPlan);                for (Iterator iterator = gratuitySituationList.iterator(); iterator.hasNext();) {                    IGratuitySituation gratuitySituation = (IGratuitySituation) iterator.next();                    //                    if                    // (gratuitySituation.getStudentCurricularPlan().getSpecialization().equals(                    //                            Specialization.INTEGRADO_TYPE)) {                    //                        //nothing to be done                    //                        continue;                    //                    }                    totalLines += addGratuityLines(outgoingSibsPaymentFile, gratuitySituation, shortYear);                }            }            // add file footer            addFooter(outgoingSibsPaymentFile, totalLines);            writeOutgoingSibsPaymentFile(executionYear, outgoingSibsPaymentFile);        } catch (ExcepcaoPersistencia e) {            FenixServiceException newEx = new FenixServiceException("Persistence layer error");            newEx.fillInStackTrace();            throw newEx;        }    }