@Test public void testExecute() throws ParseException { Query query = getEntityManager().createQuery("SELECT COUNT(*) FROM InAppNotification"); long oldCount = (Long) query.getSingleResult(); int result = (Integer) sut.execute(new SimpleDateFormat("yyyy-MM-dd HH:mm").parse("2010-02-03 00:00")); long newCount = (Long) query.getSingleResult(); assertEquals(oldCount - 6, newCount); assertEquals(6, result); }
@Override public Serializable execute(final Date startDate) { String q = "delete from InAppNotification where notificationDate <= :startDate"; Query query = getEntityManager().createQuery(q).setParameter("startDate", startDate); int count = query.executeUpdate(); return count; }
DeleteInAppNotificationsByDate extends BaseArgDomainMapper<Date, Serializable> { @Override public Serializable execute(final Date startDate) { String q = "delete from InAppNotification where notificationDate <= :startDate"; Query query = getEntityManager().createQuery(q).setParameter("startDate", startDate); int count = query.executeUpdate(); return count; } }
DeleteInAppNotificationsByDate extends BaseArgDomainMapper<Date, Serializable> { @Override public Serializable execute(final Date startDate) { String q = "delete from InAppNotification where notificationDate <= :startDate"; Query query = getEntityManager().createQuery(q).setParameter("startDate", startDate); int count = query.executeUpdate(); return count; }  }
DeleteInAppNotificationsByDate extends BaseArgDomainMapper<Date, Serializable> { @Override public Serializable execute(final Date startDate) { String q = "delete from InAppNotification where notificationDate <= :startDate"; Query query = getEntityManager().createQuery(q).setParameter("startDate", startDate); int count = query.executeUpdate(); return count; }  @Override Serializable execute(final Date startDate); }
DeleteInAppNotificationsByDate extends BaseArgDomainMapper<Date, Serializable> { @Override public Serializable execute(final Date startDate) { String q = "delete from InAppNotification where notificationDate <= :startDate"; Query query = getEntityManager().createQuery(q).setParameter("startDate", startDate); int count = query.executeUpdate(); return count; }  @Override Serializable execute(final Date startDate);  }