Package com.esprit.services.products
Class ProductService
java.lang.Object
com.esprit.services.products.ProductService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAvailableStock
(Long productId, int requestedQuantity) Performs checkAvailableStock operation.void
private void
createProductCategoryRelations
(long productId, List<ProductCategory> categories) void
private List<ProductCategory>
getCategoriesForProduct
(Long productId) getProductById
(Long productId) Retrieves the ProductById value.double
getProductPrice
(Long productId) Retrieves the ProductPrice value.getProductsByCategory
(Long categoryId) Retrieves the ProductsByCategory value.Retrieves the ProductsOrderByQuantityAndStatus value.read()
Performs sort operation.void
private void
updateProductCategoryRelations
(Long productId, List<ProductCategory> categories)
-
Field Details
-
LOGGER
-
connection
-
-
Constructor Details
-
ProductService
public ProductService()Performs ProductService operation.
-
-
Method Details
-
create
-
createProductCategoryRelations
private void createProductCategoryRelations(long productId, List<ProductCategory> categories) throws SQLException - Throws:
SQLException
-
read
-
getCategoriesForProduct
-
sort
Performs sort operation.- Returns:
- the result of the operation
-
update
-
updateProductCategoryRelations
private void updateProductCategoryRelations(Long productId, List<ProductCategory> categories) throws SQLException - Throws:
SQLException
-
delete
-
getProductById
Retrieves the ProductById value.- Returns:
- the ProductById value
-
checkAvailableStock
Performs checkAvailableStock operation.- Returns:
- the result of the operation
-
getProductPrice
Retrieves the ProductPrice value.- Returns:
- the ProductPrice value
-
getProductsByCategory
Retrieves the ProductsByCategory value.- Returns:
- the ProductsByCategory value
-
getProductsOrderByQuantityAndStatus
Retrieves the ProductsOrderByQuantityAndStatus value.- Returns:
- the ProductsOrderByQuantityAndStatus value
-