@Test public void testExecute() { final long id42 = 42L; List<InAppNotificationDTO> results = sut.execute(id42); assertEquals(5, results.size()); assertEquals(7, results.get(0).getId()); assertEquals(6, results.get(1).getId()); assertEquals(1, results.get(2).getId()); assertEquals(8, results.get(3).getId()); assertEquals(5, results.get(4).getId()); }
@Override public List<InAppNotificationDTO> execute(final Long userId) { String q = "select new org.eurekastreams.server.domain.InAppNotificationDTO (id,notificationType," + "notificationDate,message,url,highPriority,isRead,sourceType,sourceUniqueId,sourceName," + "avatarOwnerType,avatarOwnerUniqueId) from InAppNotification where recipient.id = :userId " + "order by highPriority desc, notificationDate desc"; Query query = getEntityManager().createQuery(q).setParameter("userId", userId); query.setMaxResults(count); return query.getResultList(); }
GetInAppNotificationsByUserId extends BaseArgDomainMapper<Long, List<InAppNotificationDTO>> { @Override public List<InAppNotificationDTO> execute(final Long userId) { String q = "select new org.eurekastreams.server.domain.InAppNotificationDTO (id,notificationType," + "notificationDate,message,url,highPriority,isRead,sourceType,sourceUniqueId,sourceName," + "avatarOwnerType,avatarOwnerUniqueId) from InAppNotification where recipient.id = :userId " + "order by highPriority desc, notificationDate desc"; Query query = getEntityManager().createQuery(q).setParameter("userId", userId); query.setMaxResults(count); return query.getResultList(); } }
GetInAppNotificationsByUserId extends BaseArgDomainMapper<Long, List<InAppNotificationDTO>> { @Override public List<InAppNotificationDTO> execute(final Long userId) { String q = "select new org.eurekastreams.server.domain.InAppNotificationDTO (id,notificationType," + "notificationDate,message,url,highPriority,isRead,sourceType,sourceUniqueId,sourceName," + "avatarOwnerType,avatarOwnerUniqueId) from InAppNotification where recipient.id = :userId " + "order by highPriority desc, notificationDate desc"; Query query = getEntityManager().createQuery(q).setParameter("userId", userId); query.setMaxResults(count); return query.getResultList(); } GetInAppNotificationsByUserId(final int inCount); }
GetInAppNotificationsByUserId extends BaseArgDomainMapper<Long, List<InAppNotificationDTO>> { @Override public List<InAppNotificationDTO> execute(final Long userId) { String q = "select new org.eurekastreams.server.domain.InAppNotificationDTO (id,notificationType," + "notificationDate,message,url,highPriority,isRead,sourceType,sourceUniqueId,sourceName," + "avatarOwnerType,avatarOwnerUniqueId) from InAppNotification where recipient.id = :userId " + "order by highPriority desc, notificationDate desc"; Query query = getEntityManager().createQuery(q).setParameter("userId", userId); query.setMaxResults(count); return query.getResultList(); } GetInAppNotificationsByUserId(final int inCount); @Override List<InAppNotificationDTO> execute(final Long userId); }
GetInAppNotificationsByUserId extends BaseArgDomainMapper<Long, List<InAppNotificationDTO>> { @Override public List<InAppNotificationDTO> execute(final Long userId) { String q = "select new org.eurekastreams.server.domain.InAppNotificationDTO (id,notificationType," + "notificationDate,message,url,highPriority,isRead,sourceType,sourceUniqueId,sourceName," + "avatarOwnerType,avatarOwnerUniqueId) from InAppNotification where recipient.id = :userId " + "order by highPriority desc, notificationDate desc"; Query query = getEntityManager().createQuery(q).setParameter("userId", userId); query.setMaxResults(count); return query.getResultList(); } GetInAppNotificationsByUserId(final int inCount); @Override List<InAppNotificationDTO> execute(final Long userId);  }