@Override
    public int countNotificationsByUserId(String recipientUserId, List<NotificationStatus> notificationStatus) {
        List<String> statusNames = notificationStatus.stream().map(Enum::name).collect(Collectors.toList());
        return getJdbi().withHandle(jdbi ->
             jdbi.createQuery("SELECT COUNT(n.id) "
                      + "FROM NOTIFICATIONS n "
                      + "WHERE n.recipient = :userId "
                      + "AND n.status IN (<status>)")
                 .bind("userId", recipientUserId)
                 .bindList("status", statusNames)
                 .mapTo(int.class)
                 .one()
        );
    }
Storage for simple notifications system

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/NotificationRepositoryImpl.java