@Test public void testFindForCategorySortedByRecent() { List<GalleryTabTemplateDTO> result = sut.findForCategorySortedByRecent("tc1", 0, 5).getPagedSet(); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId().toString()); }
@Override public PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String q = "SELECT NEW org.eurekastreams.server.domain.dto.GalleryTabTemplateDTO " + "(id, created, description, title, category.id, category.galleryItemType, category.name) " + "FROM GalleryTabTemplate WHERE category.name = :category ORDER BY created DESC"; PagedSet<GalleryTabTemplateDTO> results = getPagedResults(inStart, inEnd, q, parameters); populateChildTabCount(results); return results; }
GalleryTabTemplateMapper extends DomainEntityMapper<GalleryTabTemplateDTO> implements
        GalleryItemMapper<GalleryTabTemplateDTO> { @Override public PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String q = "SELECT NEW org.eurekastreams.server.domain.dto.GalleryTabTemplateDTO " + "(id, created, description, title, category.id, category.galleryItemType, category.name) " + "FROM GalleryTabTemplate WHERE category.name = :category ORDER BY created DESC"; PagedSet<GalleryTabTemplateDTO> results = getPagedResults(inStart, inEnd, q, parameters); populateChildTabCount(results); return results; } }
GalleryTabTemplateMapper extends DomainEntityMapper<GalleryTabTemplateDTO> implements
        GalleryItemMapper<GalleryTabTemplateDTO> { @Override public PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String q = "SELECT NEW org.eurekastreams.server.domain.dto.GalleryTabTemplateDTO " + "(id, created, description, title, category.id, category.galleryItemType, category.name) " + "FROM GalleryTabTemplate WHERE category.name = :category ORDER BY created DESC"; PagedSet<GalleryTabTemplateDTO> results = getPagedResults(inStart, inEnd, q, parameters); populateChildTabCount(results); return results; } GalleryTabTemplateMapper(final QueryOptimizer inQueryOptimizer); }
GalleryTabTemplateMapper extends DomainEntityMapper<GalleryTabTemplateDTO> implements
        GalleryItemMapper<GalleryTabTemplateDTO> { @Override public PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String q = "SELECT NEW org.eurekastreams.server.domain.dto.GalleryTabTemplateDTO " + "(id, created, description, title, category.id, category.galleryItemType, category.name) " + "FROM GalleryTabTemplate WHERE category.name = :category ORDER BY created DESC"; PagedSet<GalleryTabTemplateDTO> results = getPagedResults(inStart, inEnd, q, parameters); populateChildTabCount(results); return results; } GalleryTabTemplateMapper(final QueryOptimizer inQueryOptimizer); @Override void delete(final GalleryTabTemplateDTO inGalleryItem); @Override GalleryTabTemplateDTO findByUrl(final String inGalleryItemUrl); @Override PagedSet<GalleryTabTemplateDTO> findForCategorySortedByPopularity(final String inCategory,
            final int inStart, final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart,
            final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findSortedByPopularity(final int inStart, final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findSortedByRecent(final int inStart, final int inEnd); @Override void insert(final GalleryTabTemplateDTO inDomainEntity); @Override void refresh(final GalleryTabTemplateDTO inGalleryItem); @Override GalleryTabTemplateDTO findById(final Long inGalleryItemId); }
GalleryTabTemplateMapper extends DomainEntityMapper<GalleryTabTemplateDTO> implements
        GalleryItemMapper<GalleryTabTemplateDTO> { @Override public PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart, final int inEnd) { HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("category", inCategory); String q = "SELECT NEW org.eurekastreams.server.domain.dto.GalleryTabTemplateDTO " + "(id, created, description, title, category.id, category.galleryItemType, category.name) " + "FROM GalleryTabTemplate WHERE category.name = :category ORDER BY created DESC"; PagedSet<GalleryTabTemplateDTO> results = getPagedResults(inStart, inEnd, q, parameters); populateChildTabCount(results); return results; } GalleryTabTemplateMapper(final QueryOptimizer inQueryOptimizer); @Override void delete(final GalleryTabTemplateDTO inGalleryItem); @Override GalleryTabTemplateDTO findByUrl(final String inGalleryItemUrl); @Override PagedSet<GalleryTabTemplateDTO> findForCategorySortedByPopularity(final String inCategory,
            final int inStart, final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findForCategorySortedByRecent(final String inCategory, final int inStart,
            final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findSortedByPopularity(final int inStart, final int inEnd); @Override PagedSet<GalleryTabTemplateDTO> findSortedByRecent(final int inStart, final int inEnd); @Override void insert(final GalleryTabTemplateDTO inDomainEntity); @Override void refresh(final GalleryTabTemplateDTO inGalleryItem); @Override GalleryTabTemplateDTO findById(final Long inGalleryItemId);  }