@Test public void testExecuteForPersonScope() { final Long expectedActivityId = 6792L; List<Long> activityIds = sut.execute(ScopeType.PERSON, "fordp"); assertEquals(1, activityIds.size()); assertEquals(expectedActivityId, activityIds.get(0)); }
@SuppressWarnings("unchecked") public List<Long> execute(final ScopeType scopeType, final String uniqueKey) { String query = "SELECT id FROM Activity WHERE recipientStreamScope.scopeType=:scopeType " + "AND recipientStreamScope.uniqueKey = :uniqueKey"; return getEntityManager().createQuery(query).setParameter("scopeType", scopeType).setParameter("uniqueKey", uniqueKey).getResultList(); }
GetActivityIdsPostedToStreamByUniqueKeyAndScopeType extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final ScopeType scopeType, final String uniqueKey) { String query = "SELECT id FROM Activity WHERE recipientStreamScope.scopeType=:scopeType " + "AND recipientStreamScope.uniqueKey = :uniqueKey"; return getEntityManager().createQuery(query).setParameter("scopeType", scopeType).setParameter("uniqueKey", uniqueKey).getResultList(); } }
GetActivityIdsPostedToStreamByUniqueKeyAndScopeType extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final ScopeType scopeType, final String uniqueKey) { String query = "SELECT id FROM Activity WHERE recipientStreamScope.scopeType=:scopeType " + "AND recipientStreamScope.uniqueKey = :uniqueKey"; return getEntityManager().createQuery(query).setParameter("scopeType", scopeType).setParameter("uniqueKey", uniqueKey).getResultList(); }  }
GetActivityIdsPostedToStreamByUniqueKeyAndScopeType extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final ScopeType scopeType, final String uniqueKey) { String query = "SELECT id FROM Activity WHERE recipientStreamScope.scopeType=:scopeType " + "AND recipientStreamScope.uniqueKey = :uniqueKey"; return getEntityManager().createQuery(query).setParameter("scopeType", scopeType).setParameter("uniqueKey", uniqueKey).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final ScopeType scopeType, final String uniqueKey); }
GetActivityIdsPostedToStreamByUniqueKeyAndScopeType extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final ScopeType scopeType, final String uniqueKey) { String query = "SELECT id FROM Activity WHERE recipientStreamScope.scopeType=:scopeType " + "AND recipientStreamScope.uniqueKey = :uniqueKey"; return getEntityManager().createQuery(query).setParameter("scopeType", scopeType).setParameter("uniqueKey", uniqueKey).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final ScopeType scopeType, final String uniqueKey);  }