@Override
    public Optional<NotificationPreferenceEntity> getNotificationPreferenceByUserId(String userId) {
        TypedQuery<NotificationPreferenceEntity> query = getActiveEntityManager()
                .createQuery("SELECT pref FROM NotificationPreferenceEntity pref WHERE pref.user.username = :userId", NotificationPreferenceEntity.class)
                .setParameter("userId", userId);
        return super.getOne(query);
    }
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