com.silverpeas.notification.delayed.repository
Interface DelayedNotificationRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<DelayedNotificationData,Long>, DelayedNotificationRepositoryCustom, org.springframework.data.jpa.repository.JpaRepository<DelayedNotificationData,Long>, org.springframework.data.repository.PagingAndSortingRepository<DelayedNotificationData,Long>, org.springframework.data.repository.Repository<DelayedNotificationData,Long>

public interface DelayedNotificationRepository
extends org.springframework.data.jpa.repository.JpaRepository<DelayedNotificationData,Long>, DelayedNotificationRepositoryCustom

Author:
Yohann Chastagnier

Method Summary
 int deleteByIds(Collection<Long> ids)
           
 List<Integer> findAllUsersToBeNotified(Collection<Integer> aimedChannels)
           
 List<DelayedNotificationData> findByUserId(int userId, Collection<Integer> aimedChannels)
           
 
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, flush, save, saveAndFlush
 
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
 
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, delete, delete, deleteAll, exists, findAll, findOne, save
 
Methods inherited from interface com.silverpeas.notification.delayed.repository.DelayedNotificationRepositoryCustom
findDelayedNotification, findUsersToBeNotified
 

Method Detail

findAllUsersToBeNotified

@Query(value="select distinct userId from DelayedNotificationData where channel in (:channels)")
List<Integer> findAllUsersToBeNotified(@Param(value="channels")
                                             Collection<Integer> aimedChannels)

findByUserId

@Query(value="from DelayedNotificationData where userId = :userId and channel in (:channels) order by channel")
List<DelayedNotificationData> findByUserId(@Param(value="userId")
                                                 int userId,
                                                 @Param(value="channels")
                                                 Collection<Integer> aimedChannels)

deleteByIds

@Modifying
@Query(value="delete from DelayedNotificationData where id in (:ids)")
int deleteByIds(@Param(value="ids")
                                Collection<Long> ids)


Copyright © 2016 Silverpeas. All Rights Reserved.