Browse Source

JpaNotificationDao: JavaDoc added for countUnreadByRecipientId for the reference to the idx_notification_recipient_id_unread

pull/9078/head
Sergey Matvienko 3 years ago
parent
commit
3f2578b6d0
  1. 3
      dao/src/main/java/org/thingsboard/server/dao/sql/notification/JpaNotificationDao.java

3
dao/src/main/java/org/thingsboard/server/dao/sql/notification/JpaNotificationDao.java

@ -81,6 +81,9 @@ public class JpaNotificationDao extends JpaAbstractDao<NotificationEntity, Notif
return notificationRepository.updateStatusByIdAndRecipientId(notificationId.getId(), recipientId.getId(), status) != 0;
}
/**
* For this hot method, the partial index `idx_notification_recipient_id_unread` was introduced since 3.5.2
* */
@Override
public int countUnreadByRecipientId(TenantId tenantId, UserId recipientId) {
return notificationRepository.countByRecipientIdAndStatusNot(recipientId.getId(), NotificationStatus.READ);

Loading…
Cancel
Save