Interface HolidayDAO

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Holiday,Long>, org.springframework.data.jpa.repository.JpaRepository<Holiday,Long>, org.springframework.data.repository.PagingAndSortingRepository<Holiday,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Holiday>, org.springframework.data.repository.Repository<Holiday,Long>

@Repository public interface HolidayDAO extends org.springframework.data.jpa.repository.JpaRepository<Holiday,Long>
  • Method Details

    • findAll

      List<Holiday> findAll()
      Find all registered holidays
      Specified by:
      findAll in interface org.springframework.data.repository.CrudRepository<Holiday,Long>
      Specified by:
      findAll in interface org.springframework.data.jpa.repository.JpaRepository<Holiday,Long>
    • findByName

      List<Holiday> findByName(String name)
      Finds all holiday periods with the given name
    • findByStartDateEpochDayGreaterThanEqualAndEndDateEpochDayLessThanEqual

      List<Holiday> findByStartDateEpochDayGreaterThanEqualAndEndDateEpochDayLessThanEqual(long start, long end)
      finds all holiday periods contained in the indicated range
    • findByCategory

      List<Holiday> findByCategory(HolidayCategory category)
      finds all holidays of a given category
    • areThereHolidaysInYear

      @Query("select h from Holiday h where (h.startDateEpochDay >= ?1 and h.startDateEpochDay <= ?2) or (h.endDateEpochDay >= ?1 and h.endDateEpochDay <= ?2)") List<Holiday> areThereHolidaysInYear(long start, long end)
    • countByNameAndStartDateEpochDayAndEndDateEpochDay

      long countByNameAndStartDateEpochDayAndEndDateEpochDay(@NotNull @NotNull String name, long startDate, long endDate)
    • getHolidaysByCustomTrue

      List<Holiday> getHolidaysByCustomTrue()
    • deleteHolidaysFromRecurrent

      @Transactional @Modifying @Query("delete from Holiday h where h.name = ?1 and h.category = ?2 and h.location = ?3 and h.startDateEpochDay > ?4 ") void deleteHolidaysFromRecurrent(@NotNull @NotEmpty @NotNull @NotEmpty String name, @NotNull @NotNull HolidayCategory category, String location, long todayEpochDay)