@Test public void testExecuteWithResults() { final Long streamScopeId = 87433L; Assert.assertEquals(new Long(2L), sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(), streamScopeId))); }
@Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Activity WHERE recipientStreamScope.id = :recipientStreamScopeId " + "AND postedTime < :reportDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("reportDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }
GetStreamTotalActivityCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Activity WHERE recipientStreamScope.id = :recipientStreamScopeId " + "AND postedTime < :reportDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("reportDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); } }
GetStreamTotalActivityCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Activity WHERE recipientStreamScope.id = :recipientStreamScopeId " + "AND postedTime < :reportDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("reportDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  }
GetStreamTotalActivityCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Activity WHERE recipientStreamScope.id = :recipientStreamScopeId " + "AND postedTime < :reportDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("reportDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  @Override Long execute(final UsageMetricDailyStreamInfoRequest inRequest); }
GetStreamTotalActivityCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Activity WHERE recipientStreamScope.id = :recipientStreamScopeId " + "AND postedTime < :reportDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("reportDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  @Override Long execute(final UsageMetricDailyStreamInfoRequest inRequest);  }