@Test public void testExecutePerson() { final long personId = 98L; DomainMapper<Long, List<Long>> sut = new GetSubscribedPersonIdsForStreamDbMapper(EntityType.PERSON); ((BaseDomainMapper) sut).setEntityManager(getEntityManager()); List<Long> results = sut.execute(personId); assertEquals(1, results.size()); assertEquals(142L, (long) results.get(0)); }
@SuppressWarnings("unchecked") @Override public List<Long> execute(final Long inRequest) { return getEntityManager() .createQuery( "SELECT gf.pk.followerId FROM " + entityName + " gf WHERE gf.pk.followingId = :id" + " AND gf.receiveNewActivityNotifications = true").setParameter("id", inRequest) .getResultList(); }
GetSubscribedPersonIdsForStreamDbMapper extends BaseArgDomainMapper<Long, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Long inRequest) { return getEntityManager() .createQuery( "SELECT gf.pk.followerId FROM " + entityName + " gf WHERE gf.pk.followingId = :id" + " AND gf.receiveNewActivityNotifications = true").setParameter("id", inRequest) .getResultList(); } }
GetSubscribedPersonIdsForStreamDbMapper extends BaseArgDomainMapper<Long, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Long inRequest) { return getEntityManager() .createQuery( "SELECT gf.pk.followerId FROM " + entityName + " gf WHERE gf.pk.followingId = :id" + " AND gf.receiveNewActivityNotifications = true").setParameter("id", inRequest) .getResultList(); } GetSubscribedPersonIdsForStreamDbMapper(final EntityType entityType); }
GetSubscribedPersonIdsForStreamDbMapper extends BaseArgDomainMapper<Long, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Long inRequest) { return getEntityManager() .createQuery( "SELECT gf.pk.followerId FROM " + entityName + " gf WHERE gf.pk.followingId = :id" + " AND gf.receiveNewActivityNotifications = true").setParameter("id", inRequest) .getResultList(); } GetSubscribedPersonIdsForStreamDbMapper(final EntityType entityType); @SuppressWarnings("unchecked") @Override List<Long> execute(final Long inRequest); }
GetSubscribedPersonIdsForStreamDbMapper extends BaseArgDomainMapper<Long, List<Long>> { @SuppressWarnings("unchecked") @Override public List<Long> execute(final Long inRequest) { return getEntityManager() .createQuery( "SELECT gf.pk.followerId FROM " + entityName + " gf WHERE gf.pk.followingId = :id" + " AND gf.receiveNewActivityNotifications = true").setParameter("id", inRequest) .getResultList(); } GetSubscribedPersonIdsForStreamDbMapper(final EntityType entityType); @SuppressWarnings("unchecked") @Override List<Long> execute(final Long inRequest);  }