Interface RecurringNotificationRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<RecurringNotification, Long>, org.springframework.data.jpa.repository.JpaRepository<RecurringNotification, Long>, org.springframework.data.repository.ListCrudRepository<RecurringNotification, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<RecurringNotification, Long>, org.springframework.data.repository.PagingAndSortingRepository<RecurringNotification, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<RecurringNotification>, org.springframework.data.repository.Repository<RecurringNotification, Long>
@Repository
public interface RecurringNotificationRepository
extends org.springframework.data.jpa.repository.JpaRepository<RecurringNotification, Long>
Data-access layer for
RecurringNotification entities.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByUser(User user) Returns allRecurringNotifications with their associatedUser.findByNotificationTypeAndUserId(RecurringNotificationType notificationType, Long userId) Returns a recurring notification matching its type and authenticated owner.findRecurringNotificationByUserAndNotificationType(User user, RecurringNotificationType notificationType) 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
-
findByNotificationTypeAndUserId
Optional<RecurringNotification> findByNotificationTypeAndUserId(RecurringNotificationType notificationType, Long userId) Returns a recurring notification matching its type and authenticated owner.- Parameters:
notificationType- notification typeuserId- owning user id- Returns:
OptionalofRecurringNotification
-
findAllWithUser
@EntityGraph(attributePaths="user") @Query("SELECT recurringNotification FROM RecurringNotification recurringNotification ORDER BY recurringNotification.id") List<RecurringNotification> findAllWithUser()Returns allRecurringNotifications with their associatedUser.- Returns:
ListofRecurringNotification
-
findAllByUser
- Parameters:
user-User- Returns:
ListofRecurringNotification
-
findRecurringNotificationByUserAndNotificationType
RecurringNotification findRecurringNotificationByUserAndNotificationType(User user, RecurringNotificationType notificationType) - Parameters:
user-UsernotificationType-RecurringNotificationType- Returns:
RecurringNotification
-