@Test public void testFindThemesForCategorySortedByRecentReturnsRightCategory() { PagedSet<Theme> results = jpaThemeMapper.findForCategorySortedByRecent("City", 0, 1); assertEquals(2, results.getPagedSet().size()); GalleryItemCategory firstCategory = results.getPagedSet().get(0).getCategory(); GalleryItemCategory secondCategory = results.getPagedSet().get(1).getCategory(); assertEquals(firstCategory.getName(), "City"); assertEquals(secondCategory.getName(), "City"); }
public PagedSet<Theme> findForCategorySortedByRecent( final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String query = "FROM Theme " + "WHERE category.name=:category " + "order by created desc"; PagedSet<Theme> pagedSet = this.getPagedResults(inStart, inEnd, query, parameters); populateTheme(pagedSet); return pagedSet; }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public PagedSet<Theme> findForCategorySortedByRecent( final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String query = "FROM Theme " + "WHERE category.name=:category " + "order by created desc"; PagedSet<Theme> pagedSet = this.getPagedResults(inStart, inEnd, query, parameters); populateTheme(pagedSet); return pagedSet; } }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public PagedSet<Theme> findForCategorySortedByRecent( final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String query = "FROM Theme " + "WHERE category.name=:category " + "order by created desc"; PagedSet<Theme> pagedSet = this.getPagedResults(inStart, inEnd, query, parameters); populateTheme(pagedSet); return pagedSet; } ThemeMapper(final QueryOptimizer inQueryOptimizer); }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public PagedSet<Theme> findForCategorySortedByRecent( final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String query = "FROM Theme " + "WHERE category.name=:category " + "order by created desc"; PagedSet<Theme> pagedSet = this.getPagedResults(inStart, inEnd, query, parameters); populateTheme(pagedSet); return pagedSet; } ThemeMapper(final QueryOptimizer inQueryOptimizer); Theme findByUrl(final String themeLocation); Theme findByUUID(final String uuid); Theme findDefault(); PagedSet<Theme> findForCategorySortedByPopularity(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByPopularity(final int inStart,
            final int inEnd); PagedSet<Theme> findForCategorySortedByRecent(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByRecent(final int inStart, final int inEnd); void delete(final Theme inTheme); }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public PagedSet<Theme> findForCategorySortedByRecent( final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String query = "FROM Theme " + "WHERE category.name=:category " + "order by created desc"; PagedSet<Theme> pagedSet = this.getPagedResults(inStart, inEnd, query, parameters); populateTheme(pagedSet); return pagedSet; } ThemeMapper(final QueryOptimizer inQueryOptimizer); Theme findByUrl(final String themeLocation); Theme findByUUID(final String uuid); Theme findDefault(); PagedSet<Theme> findForCategorySortedByPopularity(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByPopularity(final int inStart,
            final int inEnd); PagedSet<Theme> findForCategorySortedByRecent(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByRecent(final int inStart, final int inEnd); void delete(final Theme inTheme);  }