@Test public void testFindByShortName() { DomainGroupEntity actual = jpaGroupMapper.findByShortName("group1"); assertNotNull(actual); assertEquals("E Group 1 Name", actual.getName()); }
@SuppressWarnings("unchecked") public DomainGroup findByShortName(final String groupShortName) { Query q = getEntityManager().createQuery("from DomainGroup where shortname = :inName") .setParameter("inName", groupShortName.toLowerCase()).setFlushMode(FlushModeType.COMMIT); List results = q.getResultList(); return (results.size() == 0) ? null : (DomainGroup) results.get(0); }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { @SuppressWarnings("unchecked") public DomainGroup findByShortName(final String groupShortName) { Query q = getEntityManager().createQuery("from DomainGroup where shortname = :inName") .setParameter("inName", groupShortName.toLowerCase()).setFlushMode(FlushModeType.COMMIT); List results = q.getResultList(); return (results.size() == 0) ? null : (DomainGroup) results.get(0); } }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { @SuppressWarnings("unchecked") public DomainGroup findByShortName(final String groupShortName) { Query q = getEntityManager().createQuery("from DomainGroup where shortname = :inName") .setParameter("inName", groupShortName.toLowerCase()).setFlushMode(FlushModeType.COMMIT); List results = q.getResultList(); return (results.size() == 0) ? null : (DomainGroup) results.get(0); } DomainGroupMapper(final QueryOptimizer inQueryOptimizer); }
DomainGroupMapper extends DomainEntityMapper<DomainGroup> implements FollowMapper, CompositeEntityMapper { @SuppressWarnings("unchecked") public DomainGroup findByShortName(final String groupShortName) { Query q = getEntityManager().createQuery("from DomainGroup where shortname = :inName") .setParameter("inName", groupShortName.toLowerCase()).setFlushMode(FlushModeType.COMMIT); List results = q.getResultList(); return (results.size() == 0) ? null : (DomainGroup) results.get(0); } 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 { @SuppressWarnings("unchecked") public DomainGroup findByShortName(final String groupShortName) { Query q = getEntityManager().createQuery("from DomainGroup where shortname = :inName") .setParameter("inName", groupShortName.toLowerCase()).setFlushMode(FlushModeType.COMMIT); List results = q.getResultList(); return (results.size() == 0) ? null : (DomainGroup) results.get(0); } 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);  }