Interface CalendarLinkDAO

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

public interface CalendarLinkDAO extends org.springframework.data.jpa.repository.JpaRepository<CalendarLinkEntity,Long>
Reads and writes calendar links. The two single-row lookups hit a unique column and need no page; the listing by owners takes one.
  • Method Summary

    Modifier and Type
    Method
    Description
    findByCalendarId(long calendarId)
    Finds the link of a calendar.
    findByCalendarOwnerIds(Collection<Long> ownerIds, org.springframework.data.domain.Pageable pageable)
    Finds the links of the calendars some identities own, in one statement: the links joined to their calendars and filtered on the calendars' owners, newest first.
    Finds the link a token digest opens.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByCalendarId

      CalendarLinkEntity findByCalendarId(long calendarId)
      Finds the link of a calendar.
      Parameters:
      calendarId - technical identifier of the calendar
      Returns:
      the link, or null when the calendar has none
    • findByTokenHash

      CalendarLinkEntity findByTokenHash(String tokenHash)
      Finds the link a token digest opens.
      Parameters:
      tokenHash - lowercase hexadecimal SHA-256 digest of a token
      Returns:
      the link, or null when no link carries that digest
    • findByCalendarOwnerIds

      @Query("SELECT link FROM AgendaCalendarLink link, AgendaCalendar calendar WHERE calendar.id = link.calendarId AND calendar.ownerId IN (:ownerIds) ORDER BY link.createdDate DESC, link.id DESC") List<CalendarLinkEntity> findByCalendarOwnerIds(@Param("ownerIds") Collection<Long> ownerIds, org.springframework.data.domain.Pageable pageable)
      Finds the links of the calendars some identities own, in one statement: the links joined to their calendars and filtered on the calendars' owners, newest first.
      Parameters:
      ownerIds - identity identifiers owning the calendars, never empty
      pageable - the page to read
      Returns:
      the links, newest first