Package org.exoplatform.agenda.dao
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 TypeMethodDescriptionfindByCalendarId(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.findByTokenHash(String tokenHash) Finds the link a token digest opens.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByCalendarId
Finds the link of a calendar.- Parameters:
calendarId- technical identifier of the calendar- Returns:
- the link, or null when the calendar has none
-
findByTokenHash
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 emptypageable- the page to read- Returns:
- the links, newest first
-