Package com.esprit.services.products
Class CategoryService
java.lang.Object
com.esprit.services.products.CategoryService
- All Implemented Interfaces:
IService<ProductCategory>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProductToCategory
(int productId, int categoryId) Performs addProductToCategory operation.void
create
(ProductCategory productCategory) void
delete
(ProductCategory productCategory) Retrieves the AllCategories value.Retrieves the AllCategoriesNames value.getCategoriesForProduct
(int productId) Retrieves the CategoriesForProduct value.getCategory
(long categoryId) Retrieves the Category value.getCategoryByName
(String categoryName) Retrieves the CategoryByName value.int
getProductCountForCategory
(int categoryId) Retrieves the ProductCountForCategory value.read()
void
removeProductFromCategory
(int productId, int categoryId) Performs removeProductFromCategory operation.searchCategoriesByName
(String searchKeyword) Performs searchCategoriesByName operation.void
update
(ProductCategory productCategory)
-
Field Details
-
LOGGER
-
connection
-
-
Constructor Details
-
CategoryService
public CategoryService()Performs CategoryService operation.
-
-
Method Details
-
create
- Specified by:
create
in interfaceIService<ProductCategory>
-
read
- Specified by:
read
in interfaceIService<ProductCategory>
-
update
- Specified by:
update
in interfaceIService<ProductCategory>
-
delete
- Specified by:
delete
in interfaceIService<ProductCategory>
-
getCategory
Retrieves the Category value.- Returns:
- the Category value
-
getCategoryByName
Retrieves the CategoryByName value.- Returns:
- the CategoryByName value
-
getAllCategoriesNames
Retrieves the AllCategoriesNames value.- Returns:
- the AllCategoriesNames value
-
getAllCategories
Retrieves the AllCategories value.- Returns:
- the AllCategories value
-
searchCategoriesByName
Performs searchCategoriesByName operation.- Returns:
- the result of the operation
-
getCategoriesForProduct
Retrieves the CategoriesForProduct value.- Returns:
- the CategoriesForProduct value
-
addProductToCategory
public void addProductToCategory(int productId, int categoryId) Performs addProductToCategory operation. -
removeProductFromCategory
public void removeProductFromCategory(int productId, int categoryId) Performs removeProductFromCategory operation. -
getProductCountForCategory
public int getProductCountForCategory(int categoryId) Retrieves the ProductCountForCategory value.- Returns:
- the ProductCountForCategory value
-