@Test public void testExecuteWithNoResults() { final Long streamScopeId = 87433388L; Assert.assertEquals(new Long(0), sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(), streamScopeId))); }
@Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Comment WHERE target.recipientStreamScope.id = :recipientStreamScopeId " + "AND timeSent < :requestDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("requestDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }
GetStreamTotalCommentCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Comment WHERE target.recipientStreamScope.id = :recipientStreamScopeId " + "AND timeSent < :requestDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("requestDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); } }
GetStreamTotalCommentCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Comment WHERE target.recipientStreamScope.id = :recipientStreamScopeId " + "AND timeSent < :requestDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("requestDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  }
GetStreamTotalCommentCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Comment WHERE target.recipientStreamScope.id = :recipientStreamScopeId " + "AND timeSent < :requestDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("requestDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  @Override Long execute(final UsageMetricDailyStreamInfoRequest inRequest); }
GetStreamTotalCommentCountDbMapper extends BaseArgDomainMapper<UsageMetricDailyStreamInfoRequest, Long> { @Override public Long execute(final UsageMetricDailyStreamInfoRequest inRequest) { return (Long) getEntityManager() .createQuery( "SELECT COUNT(id) FROM Comment WHERE target.recipientStreamScope.id = :recipientStreamScopeId " + "AND timeSent < :requestDate") .setParameter("recipientStreamScopeId", inRequest.getStreamRecipientStreamScopeId()) .setParameter("requestDate", DateDayExtractor.getEndOfDay(inRequest.getMetricsDate())) .getSingleResult(); }  @Override Long execute(final UsageMetricDailyStreamInfoRequest inRequest);  }