@Test public void testGetFollowing() { final long followedGroupId = 1L; PagedSet<Followable> followedGroups = jpaGroupMapper.getFollowing("mrburns", 0, 9); assertEquals(1, followedGroups.getTotal()); assertEquals(0, followedGroups.getFromIndex()); assertEquals(0, followedGroups.getToIndex()); List<Followable> groups = followedGroups.getPagedSet(); assertEquals(1, groups.size()); assertEquals(followedGroupId, groups.get(0).getId()); }
public PagedSet<Followable> getFollowing(final String accountId, final int start, final int end) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("accountId", accountId); String query = "select p.followingGroup from Person p where p.accountId = :accountId"; PagedSet<Followable> results = getTypedPagedResults(start, end, query, parameters); return results; }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { public PagedSet<Followable> getFollowing(final String accountId, final int start, final int end) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("accountId", accountId); String query = "select p.followingGroup from Person p where p.accountId = :accountId"; PagedSet<Followable> results = getTypedPagedResults(start, end, query, parameters); return results; } }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { public PagedSet<Followable> getFollowing(final String accountId, final int start, final int end) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("accountId", accountId); String query = "select p.followingGroup from Person p where p.accountId = :accountId"; PagedSet<Followable> results = getTypedPagedResults(start, end, query, parameters); return results; } DomainGroupMapper(final QueryOptimizer inQueryOptimizer); }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { public PagedSet<Followable> getFollowing(final String accountId, final int start, final int end) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("accountId", accountId); String query = "select p.followingGroup from Person p where p.accountId = :accountId"; PagedSet<Followable> results = getTypedPagedResults(start, end, query, parameters); return results; } DomainGroupMapper(final QueryOptimizer inQueryOptimizer); @SuppressWarnings("unchecked") DomainGroup findByShortName(final String groupShortName); void addFollower(final long followerId, final long followingId); PagedSet<Person> getFollowers(final String shortName, final int start, final int end); PagedSet<Followable> getFollowing(final String accountId, final int start, final int end); @SuppressWarnings("unchecked") boolean isFollowing(final String followerAccountId, final String shortName); void removeFollower(final long followerId, final long followingId); void removeGroupCoordinator(final long followerId, final long followingId); @SuppressWarnings("unchecked") Long[] getFollowerAndCoordinatorPersonIds(final DomainGroup domainGroup); void deleteById(final long id); boolean isInputUserGroupCoordinator(final long followerId, final long followingId); boolean isGroupPrivate(final long followingId); int getGroupCoordinatorCount(final long followingId); }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { public PagedSet<Followable> getFollowing(final String accountId, final int start, final int end) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("accountId", accountId); String query = "select p.followingGroup from Person p where p.accountId = :accountId"; PagedSet<Followable> results = getTypedPagedResults(start, end, query, parameters); return results; } DomainGroupMapper(final QueryOptimizer inQueryOptimizer); @SuppressWarnings("unchecked") DomainGroup findByShortName(final String groupShortName); void addFollower(final long followerId, final long followingId); PagedSet<Person> getFollowers(final String shortName, final int start, final int end); PagedSet<Followable> getFollowing(final String accountId, final int start, final int end); @SuppressWarnings("unchecked") boolean isFollowing(final String followerAccountId, final String shortName); void removeFollower(final long followerId, final long followingId); void removeGroupCoordinator(final long followerId, final long followingId); @SuppressWarnings("unchecked") Long[] getFollowerAndCoordinatorPersonIds(final DomainGroup domainGroup); void deleteById(final long id); boolean isInputUserGroupCoordinator(final long followerId, final long followingId); boolean isGroupPrivate(final long followingId); int getGroupCoordinatorCount(final long followingId);  }