Fix problems with calendar exception types bootstrap

When deploying again after having imported projects, the calendar bootstrap was wrongly trying to save
a repeated calendar exception day.

FEA: ItEr77S05BasicProjectImport
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-27 17:07:29 +01:00
parent a7c3682a52
commit 24326238a2

View file

@ -59,9 +59,8 @@ public class CalendarBootstrap implements ICalendarBootstrap {
calendarExceptionTypeDAO.save(calendarExceptionType);
}
}
if (!calendarExceptionTypeDAO.getAll().contains(
PredefinedCalendarExceptionTypes.NOT_WORKING_DAY
.getCalendarExceptionType())) {
if (!calendarExceptionTypeDAO.existsByName(PredefinedCalendarExceptionTypes.NOT_WORKING_DAY
.getCalendarExceptionType())) {
CalendarExceptionType calendarExceptionType = PredefinedCalendarExceptionTypes.NOT_WORKING_DAY
.getCalendarExceptionType();
calendarExceptionType
@ -70,8 +69,7 @@ public class CalendarBootstrap implements ICalendarBootstrap {
calendarExceptionType.setCodeAutogenerated(true);
calendarExceptionTypeDAO.save(calendarExceptionType);
}
if (!calendarExceptionTypeDAO.getAll().contains(
PredefinedCalendarExceptionTypes.WORKING_DAY
if (!calendarExceptionTypeDAO.existsByName(PredefinedCalendarExceptionTypes.WORKING_DAY
.getCalendarExceptionType())) {
CalendarExceptionType calendarExceptionType = PredefinedCalendarExceptionTypes.WORKING_DAY
.getCalendarExceptionType();