@Test public void findBySubjectOpenSocialIdWithNoResults() { List<Recommendation> actual = jpaRecommendationMapper.findBySubjectOpenSocialId("no-such-id"); assertEquals(0, actual.size()); }
@SuppressWarnings("unchecked") public List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId) { Query q = getEntityManager().createQuery( "from Recommendation where subjectOpenSocialId = :openSocialId order by date DESC").setParameter( "openSocialId", subjectOpenSocialId); List<Recommendation> results = q.getResultList(); return results; }
RecommendationMapper extends DomainEntityMapper<Recommendation> { @SuppressWarnings("unchecked") public List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId) { Query q = getEntityManager().createQuery( "from Recommendation where subjectOpenSocialId = :openSocialId order by date DESC").setParameter( "openSocialId", subjectOpenSocialId); List<Recommendation> results = q.getResultList(); return results; } }
RecommendationMapper extends DomainEntityMapper<Recommendation> { @SuppressWarnings("unchecked") public List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId) { Query q = getEntityManager().createQuery( "from Recommendation where subjectOpenSocialId = :openSocialId order by date DESC").setParameter( "openSocialId", subjectOpenSocialId); List<Recommendation> results = q.getResultList(); return results; } RecommendationMapper(final QueryOptimizer inQueryOptimizer); }
RecommendationMapper extends DomainEntityMapper<Recommendation> { @SuppressWarnings("unchecked") public List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId) { Query q = getEntityManager().createQuery( "from Recommendation where subjectOpenSocialId = :openSocialId order by date DESC").setParameter( "openSocialId", subjectOpenSocialId); List<Recommendation> results = q.getResultList(); return results; } RecommendationMapper(final QueryOptimizer inQueryOptimizer); @SuppressWarnings("unchecked") List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId); @SuppressWarnings("unchecked") List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId, final int maxResults); void delete(final long id); }
RecommendationMapper extends DomainEntityMapper<Recommendation> { @SuppressWarnings("unchecked") public List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId) { Query q = getEntityManager().createQuery( "from Recommendation where subjectOpenSocialId = :openSocialId order by date DESC").setParameter( "openSocialId", subjectOpenSocialId); List<Recommendation> results = q.getResultList(); return results; } RecommendationMapper(final QueryOptimizer inQueryOptimizer); @SuppressWarnings("unchecked") List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId); @SuppressWarnings("unchecked") List<Recommendation> findBySubjectOpenSocialId(final String subjectOpenSocialId, final int maxResults); void delete(final long id);  }