Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1237 → Rev 1241

/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportTeachersService.java
192,6 → 192,7
serviceLogInfo("#Teachers Zero Units: " + teachersZeroUnits);
serviceLogInfo("#Units not found: " + unitsNotFound);
serviceLogInfo("#Units with NULL COURSE : " + unitsNotFoundCourseNotFound);
serviceLogInfo("#Units added to multiple courses because NULL COURSE : " + unitsFoundForCourseNotFound);
serviceLogInfo("#Units removed to Teachers: " + unitsRemovedToTeachers);
serviceLogInfo("#Units added to Teachers: " + unitsAddedToTeachers);
serviceLogInfo("#Units not Removed because localy added: " + unitsLocalAddedNotRemoved);
204,6 → 205,7
logger.info("#Teachers Zero Units: " + teachersZeroUnits);
logger.info("#Units not found: " + unitsNotFound);
logger.info("#Units with NULL COURSE : " + unitsNotFoundCourseNotFound);
logger.info("#Units added to multiple courses because NULL COURSE : " + unitsFoundForCourseNotFound);
logger.info("#Units removed to Teachers: " + unitsRemovedToTeachers);
logger.info("#Units added to Teachers: " + unitsAddedToTeachers);
logger.info("#Units not Removed because localy added: " + unitsLocalAddedNotRemoved);
492,6 → 494,8
msgS+=" } all added to teacher: " + teacher.getSigesCode();
logmessages.addMessage(new DefaultLogMessage("import.teachers", LogMessageTypeEnum.WARNING,msgS ));
unitsFoundForCourseNotFound++;
logger.warn(msgS);
serviceLogWarn(msgS);
}
}
else{
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitImpl.java
94,15 → 94,18
if(anotherInstance instanceof CourseUnitImpl)
{
CourseUnitImpl anCourseUnit = (CourseUnitImpl) anotherInstance;
boolean turmaVazia =getCdTurma() == null || getCdTurma().trim().length() == 0;
boolean anotherTurmaVazia = anCourseUnit.getCdTurma() == null || anCourseUnit.getCdTurma().trim().length() == 0;
boolean turmasIguais = (turmaVazia && anotherTurmaVazia) || (!turmaVazia && !anotherTurmaVazia && getCdTurma().equals(anCourseUnit.getCdTurma()));
//turma rollback
//boolean turmaVazia = getCdTurma() == null || getCdTurma().trim().length() == 0;
//boolean anotherTurmaVazia = anCourseUnit.getCdTurma() == null || anCourseUnit.getCdTurma().trim().length() == 0;
//boolean turmasIguais = (turmaVazia && anotherTurmaVazia) || (!turmaVazia && !anotherTurmaVazia && getCdTurma().equals(anCourseUnit.getCdTurma()));
 
return anCourseUnit.getCode() != null && getCode() != null && getCode().equals(anCourseUnit.getCode()) &&
anCourseUnit.getCourseCode() != null && getCourseCode() != null && getCourseCode().equals(anCourseUnit.getCourseCode()) &&
anCourseUnit.getSemestre() != null && getSemestre() != null && getSemestre().equals(anCourseUnit.getSemestre()) &&
anCourseUnit.getImportYear() != null && getImportYear() != null && getImportYear().equals(anCourseUnit.getImportYear()) &&
turmasIguais;
//return anCourseUnit.getCode() != null && getCode() != null && getCode().equals(anCourseUnit.getCode()) &&
// anCourseUnit.getCourseCode() != null && getCourseCode() != null && getCourseCode().equals(anCourseUnit.getCourseCode()) &&
// anCourseUnit.getSemestre() != null && getSemestre() != null && getSemestre().equals(anCourseUnit.getSemestre()) &&
// anCourseUnit.getImportYear() != null && getImportYear() != null && getImportYear().equals(anCourseUnit.getImportYear());
//&&
// turmasIguais;
return equalsIgnoringTurma(anotherInstance);
}
return false;
 
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml
311,12 → 311,12
<key column="courseUnitTurma"/>
<one-to-many class="pt.estgp.estgweb.domain.CourseUnitTurmaDocenteTipologia"/>
</set>
<set name="teachers" lazy="true" table="teachedunits">
<key column="courseUnitId"/>
<set name="teachers" lazy="true" table="teachedturmaunits">
<key column="courseUnitTurmaId"/>
<many-to-many class="pt.estgp.estgweb.domain.TeacherImpl" column="teacherId"/>
</set>
<set name="students" lazy="true" table="subscribedunits">
<key column="courseUnitId"/>
<set name="students" lazy="true" table="subscribedturmaunits">
<key column="courseUnitTurmaId"/>
<many-to-many class="pt.estgp.estgweb.domain.StudentImpl" column="studentId"/>
</set>
<subclass name="pt.estgp.estgweb.domain.CourseUnitTurmaImpl" discriminator-value="CourseUnitTurmaImpl"/>