public class CategoryFacadeImpl extends Object implements CategoryFacade
Constructor and Description |
---|
CategoryFacadeImpl(CategoryService categoryService)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Category |
createOrUpdateCategory(String name,
String desctription)
Creates a new category, or updates it if another one with given name exist;
|
List<Category> |
getAllCategories()
Get all categories from db.
|
Category |
getCategoryByName(String name)
Find category with given name in db.
|
public CategoryFacadeImpl(CategoryService categoryService)
categoryService
- categoryServicepublic Category createOrUpdateCategory(String name, String desctription) throws ServiceException
CategoryFacade
createOrUpdateCategory
in interface CategoryFacade
name
- name of the categorydesctription
- description of the categoryServiceException
- if something goes wrong on the db layer and service layer cannot deal with itpublic List<Category> getAllCategories()
CategoryFacade
getAllCategories
in interface CategoryFacade
public Category getCategoryByName(String name)
CategoryFacade
getCategoryByName
in interface CategoryFacade
name
- name of categoryCopyright © 2017 Pivotal Software, Inc.. All rights reserved.