RED-6310: Refomatted sql query for readability
This commit is contained in:
parent
a32d2bbd41
commit
1fb8e0c135
@ -15,11 +15,19 @@ public interface NotificationRepository extends JpaRepository<NotificationEntity
|
||||
int hasInAppNotificationForUser(String userId, OffsetDateTime since);
|
||||
|
||||
|
||||
@Query("select n from NotificationEntity n where " + " (exists (select e from NotificationPreferencesEntity e where e.userId = :userId) and n.notificationType in ( select apn from NotificationPreferencesEntity p join p.inAppNotifications apn where p.userId = :userId and p.inAppNotificationsEnabled = true )) " + " and n.softDeleted is null and n.userId = :userId order by n.creationDate desc")
|
||||
@Query("""
|
||||
select n from NotificationEntity n where
|
||||
(exists (select e from NotificationPreferencesEntity e where e.userId = :userId) and n.notificationType in
|
||||
(select apn from NotificationPreferencesEntity p join p.inAppNotifications apn where p.userId = :userId and p.inAppNotificationsEnabled = true))
|
||||
and n.softDeleted is null and n.userId = :userId order by n.creationDate desc""")
|
||||
List<NotificationEntity> findAppNotificationsForUser(String userId);
|
||||
|
||||
|
||||
@Query("select n from NotificationEntity n where " + " (exists (select e from NotificationPreferencesEntity e where e.userId = :userId) and n.notificationType in ( select apn from NotificationPreferencesEntity p join p.inAppNotifications apn where p.userId = :userId and p.inAppNotificationsEnabled = true )) " + " and n.seenDate is null and n.softDeleted is null and n.userId = :userId order by n.creationDate desc ")
|
||||
@Query("""
|
||||
select n from NotificationEntity n where
|
||||
(exists (select e from NotificationPreferencesEntity e where e.userId = :userId) and n.notificationType in
|
||||
(select apn from NotificationPreferencesEntity p join p.inAppNotifications apn where p.userId = :userId and p.inAppNotificationsEnabled = true))
|
||||
and n.seenDate is null and n.softDeleted is null and n.userId = :userId order by n.creationDate desc""")
|
||||
List<NotificationEntity> findUnseenNotificationsForUser(String userId);
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user