@Test public void getCategoryList_shouldFindListWithExistingCategories() { Category existingCategory = createCategoryBuilderWithAllFields().build(); persistence.create(existingCategory); List<Category> categories = persistence.getCategoryList(); assertThat(categories.size(), is(1)); assertReflectionEquals(existingCategory, categories.get(0)); }
@Override public List<Category> getCategoryList() { Query query = getEntityManager().createQuery("select c from Category c"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); closeEntityManager(); logger.info("Read [{}] categories", categories.size()); return categories; }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = getEntityManager().createQuery("select c from Category c"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); closeEntityManager(); logger.info("Read [{}] categories", categories.size()); return categories; } }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = getEntityManager().createQuery("select c from Category c"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); closeEntityManager(); logger.info("Read [{}] categories", categories.size()); return categories; }  }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = getEntityManager().createQuery("select c from Category c"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); closeEntityManager(); logger.info("Read [{}] categories", categories.size()); return categories; }  @Override List<Category> getCategoryList(); @Override Category getCategory(final String categoryId); }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = getEntityManager().createQuery("select c from Category c"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); closeEntityManager(); logger.info("Read [{}] categories", categories.size()); return categories; }  @Override List<Category> getCategoryList(); @Override Category getCategory(final String categoryId);  }