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();