From 24326238a274fd50678ed7cfaa413dbe5df73269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Wed, 27 Mar 2013 17:07:29 +0100 Subject: [PATCH] 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 --- .../business/calendars/entities/CalendarBootstrap.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/CalendarBootstrap.java b/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/CalendarBootstrap.java index 64d7f5143..fe3c32428 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/CalendarBootstrap.java +++ b/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/CalendarBootstrap.java @@ -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();