@Test public void testExecuteWithNullCategories() { Collection<NotificationFilterPreferenceDTO> list = sut.execute(new GetNotificationFilterPreferenceRequest( Collections.singleton(BURNS_ID), null)); assertEquals(0, list.size()); }
@Override @SuppressWarnings("unchecked") public List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request) { if (request.getPersonIds() == null || request.getPersonIds().isEmpty() || request.getCategories() == null || request.getCategories().isEmpty()) { return Collections.EMPTY_LIST; } String q = "SELECT new org.eurekastreams.server.domain.NotificationFilterPreferenceDTO " + "(person.id, notifierType, notificationCategory) FROM NotificationFilterPreference " + "WHERE person.id IN (:personIds) AND notificationCategory in (:categories)"; Query query = getEntityManager().createQuery(q).setParameter("personIds", request.getPersonIds()) .setParameter("categories", request.getCategories()); return query.getResultList(); }
GetNotificationFilterPreferencesByPersonIdsAndCategories extends BaseDomainMapper implements
        DomainMapper<GetNotificationFilterPreferenceRequest, List<NotificationFilterPreferenceDTO>> { @Override @SuppressWarnings("unchecked") public List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request) { if (request.getPersonIds() == null || request.getPersonIds().isEmpty() || request.getCategories() == null || request.getCategories().isEmpty()) { return Collections.EMPTY_LIST; } String q = "SELECT new org.eurekastreams.server.domain.NotificationFilterPreferenceDTO " + "(person.id, notifierType, notificationCategory) FROM NotificationFilterPreference " + "WHERE person.id IN (:personIds) AND notificationCategory in (:categories)"; Query query = getEntityManager().createQuery(q).setParameter("personIds", request.getPersonIds()) .setParameter("categories", request.getCategories()); return query.getResultList(); } }
GetNotificationFilterPreferencesByPersonIdsAndCategories extends BaseDomainMapper implements
        DomainMapper<GetNotificationFilterPreferenceRequest, List<NotificationFilterPreferenceDTO>> { @Override @SuppressWarnings("unchecked") public List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request) { if (request.getPersonIds() == null || request.getPersonIds().isEmpty() || request.getCategories() == null || request.getCategories().isEmpty()) { return Collections.EMPTY_LIST; } String q = "SELECT new org.eurekastreams.server.domain.NotificationFilterPreferenceDTO " + "(person.id, notifierType, notificationCategory) FROM NotificationFilterPreference " + "WHERE person.id IN (:personIds) AND notificationCategory in (:categories)"; Query query = getEntityManager().createQuery(q).setParameter("personIds", request.getPersonIds()) .setParameter("categories", request.getCategories()); return query.getResultList(); }  }
GetNotificationFilterPreferencesByPersonIdsAndCategories extends BaseDomainMapper implements
        DomainMapper<GetNotificationFilterPreferenceRequest, List<NotificationFilterPreferenceDTO>> { @Override @SuppressWarnings("unchecked") public List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request) { if (request.getPersonIds() == null || request.getPersonIds().isEmpty() || request.getCategories() == null || request.getCategories().isEmpty()) { return Collections.EMPTY_LIST; } String q = "SELECT new org.eurekastreams.server.domain.NotificationFilterPreferenceDTO " + "(person.id, notifierType, notificationCategory) FROM NotificationFilterPreference " + "WHERE person.id IN (:personIds) AND notificationCategory in (:categories)"; Query query = getEntityManager().createQuery(q).setParameter("personIds", request.getPersonIds()) .setParameter("categories", request.getCategories()); return query.getResultList(); }  @Override @SuppressWarnings("unchecked") List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request); }
GetNotificationFilterPreferencesByPersonIdsAndCategories extends BaseDomainMapper implements
        DomainMapper<GetNotificationFilterPreferenceRequest, List<NotificationFilterPreferenceDTO>> { @Override @SuppressWarnings("unchecked") public List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request) { if (request.getPersonIds() == null || request.getPersonIds().isEmpty() || request.getCategories() == null || request.getCategories().isEmpty()) { return Collections.EMPTY_LIST; } String q = "SELECT new org.eurekastreams.server.domain.NotificationFilterPreferenceDTO " + "(person.id, notifierType, notificationCategory) FROM NotificationFilterPreference " + "WHERE person.id IN (:personIds) AND notificationCategory in (:categories)"; Query query = getEntityManager().createQuery(q).setParameter("personIds", request.getPersonIds()) .setParameter("categories", request.getCategories()); return query.getResultList(); }  @Override @SuppressWarnings("unchecked") List<NotificationFilterPreferenceDTO> execute(final GetNotificationFilterPreferenceRequest request);  }