ICourseReport courseReport = new CourseReport(); ps.getIPersistentCourseReport().simpleLockWrite(courseReport); courseReport.setExecutionCourse(executionCourse);  ps.getIPersistentExecutionCourse().simpleLockWrite(executionCourse); executionCourse.setCourseReport(courseReport);
ICourseReport courseReport = DomainFactory.makeCourseReport(); courseReport.setExecutionCourse(executionCourse);
    public void run(Integer executionPeriodID) throws ExcepcaoPersistencia {        ISuportePersistente ps = PersistenceSupportFactory.getDefaultPersistenceSupport();        Set<Integer> courseReportsExecutionCoursesIDs = new HashSet<Integer>();        List<IExecutionCourse> executionCourses = ps.getIPersistentExecutionCourse()                .readByExecutionPeriod(executionPeriodID);        for (IExecutionCourse executionCourse : executionCourses) {            if (executionCourse.getCourseReport() == null) {                for (IEvaluation evaluation : (List<IEvaluation>) executionCourse                        .getAssociatedEvaluations()) {                    if (evaluation instanceof Proxy) {                        evaluation = (IEvaluation) ProxyHelper.getRealObject(evaluation);                    }                    if (evaluation instanceof IFinalEvaluation) {                        if (courseReportsExecutionCoursesIDs.add(executionCourse.getIdInternal())) {                            ICourseReport courseReport = new CourseReport();                            ps.getIPersistentCourseReport().simpleLockWrite(courseReport);                            courseReport.setExecutionCourse(executionCourse);                                                        ps.getIPersistentExecutionCourse().simpleLockWrite(executionCourse);                            executionCourse.setCourseReport(courseReport);                                                    }                    }                }            }        }    }