@Test public void getsACategoryList() { Category persistedCategory = createCategoryBuilderWithAllFields().build(); persistence.getEntityManager().persist(persistedCategory); persistence.flushContext(); persistence.detachEntity(persistedCategory); assertFalse(persistence.contextContains(persistedCategory)); List<Category> categories = persistence.getCategoryList(); assertThat(categories.size(), equalTo(1)); assertReflectionEquals(persistedCategory, categories.get(0)); }
@Override public List<Category> getCategoryList() { Query query = createNamedQuery("Category.getCategoryList"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); logger.info("Read [{}] categories", categories.size()); return categories; }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = createNamedQuery("Category.getCategoryList"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); logger.info("Read [{}] categories", categories.size()); return categories; } }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = createNamedQuery("Category.getCategoryList"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); logger.info("Read [{}] categories", categories.size()); return categories; }  }
CategoryBasePersistence extends AbstractBasePersistence<Category, String> implements CategoryMapper { @Override public List<Category> getCategoryList() { Query query = createNamedQuery("Category.getCategoryList"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); 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 = createNamedQuery("Category.getCategoryList"); @SuppressWarnings("unchecked") List<Category> categories = (List<Category>) query.getResultList(); logger.info("Read [{}] categories", categories.size()); return categories; }  @Override List<Category> getCategoryList(); @Override Category getCategory(final String categoryId);  }