@Test public void testExecute() { Query query = getEntityManager().createQuery("SELECT COUNT(*) FROM InAppNotification"); long oldCount = (Long) query.getSingleResult(); final long id42 = 42L; InAppNotificationsByUserMapperRequest rqst = new InAppNotificationsByUserMapperRequest(Arrays.asList(1L, 2L, 3L, 9L * 9L), id42); sut.execute(rqst); long newCount = (Long) query.getSingleResult(); assertEquals(oldCount - 2, newCount); }
@Override public Serializable execute(final InAppNotificationsByUserMapperRequest inRequest) { String q = "delete from InAppNotification where recipient.id = :userId and id in (:ids)"; Query query = getEntityManager().createQuery(q).setParameter("userId", inRequest.getPersonId()) .setParameter("ids", inRequest.getNotificationIds()); query.executeUpdate(); return null; }
DeleteInAppNotifications extends BaseArgDomainMapper<InAppNotificationsByUserMapperRequest, Serializable> { @Override public Serializable execute(final InAppNotificationsByUserMapperRequest inRequest) { String q = "delete from InAppNotification where recipient.id = :userId and id in (:ids)"; Query query = getEntityManager().createQuery(q).setParameter("userId", inRequest.getPersonId()) .setParameter("ids", inRequest.getNotificationIds()); query.executeUpdate(); return null; } }
DeleteInAppNotifications extends BaseArgDomainMapper<InAppNotificationsByUserMapperRequest, Serializable> { @Override public Serializable execute(final InAppNotificationsByUserMapperRequest inRequest) { String q = "delete from InAppNotification where recipient.id = :userId and id in (:ids)"; Query query = getEntityManager().createQuery(q).setParameter("userId", inRequest.getPersonId()) .setParameter("ids", inRequest.getNotificationIds()); query.executeUpdate(); return null; }  }
DeleteInAppNotifications extends BaseArgDomainMapper<InAppNotificationsByUserMapperRequest, Serializable> { @Override public Serializable execute(final InAppNotificationsByUserMapperRequest inRequest) { String q = "delete from InAppNotification where recipient.id = :userId and id in (:ids)"; Query query = getEntityManager().createQuery(q).setParameter("userId", inRequest.getPersonId()) .setParameter("ids", inRequest.getNotificationIds()); query.executeUpdate(); return null; }  @Override Serializable execute(final InAppNotificationsByUserMapperRequest inRequest); }
DeleteInAppNotifications extends BaseArgDomainMapper<InAppNotificationsByUserMapperRequest, Serializable> { @Override public Serializable execute(final InAppNotificationsByUserMapperRequest inRequest) { String q = "delete from InAppNotification where recipient.id = :userId and id in (:ids)"; Query query = getEntityManager().createQuery(q).setParameter("userId", inRequest.getPersonId()) .setParameter("ids", inRequest.getNotificationIds()); query.executeUpdate(); return null; }  @Override Serializable execute(final InAppNotificationsByUserMapperRequest inRequest);  }