Package com.masai.Dao
Interface ProductDao
- All Known Implementing Classes:
ProductDaoImpl
public interface ProductDao
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addProductBySeller
(Product product) Adds a new product by a seller.int
getGStPercentage
(int productId) Retrieves the GST percentage of a product based on its product ID.getProductById
(int productId) Retrieves a product based on its product ID.int
getProductIdByCategoryName
(String catgoryName) Retrieves the product ID based on the category name.boolean
returnProduct
(ReturnProduct returnProduct) Processes the return of a product.boolean
updateProductBySeller
(Product product, int id) Updates a product by a seller.boolean
updateQuantity
(int productId, int quantity) Updates the quantity of a product based on its product ID.
-
Method Details
-
updateQuantity
boolean updateQuantity(int productId, int quantity) Updates the quantity of a product based on its product ID.- Parameters:
productId
- The ID of the product.quantity
- The new quantity of the product.- Returns:
true
if the quantity was successfully updated,false
otherwise.
-
getGStPercentage
int getGStPercentage(int productId) Retrieves the GST percentage of a product based on its product ID.- Parameters:
productId
- The ID of the product.- Returns:
- The GST percentage of the product.
-
getProductById
Retrieves a product based on its product ID.- Parameters:
productId
- The ID of the product.- Returns:
- The product object.
-
updateProductBySeller
Updates a product by a seller.- Parameters:
product
- The updated product object.id
- The ID of the product to update.- Returns:
true
if the product was successfully updated,false
otherwise.
-
addProductBySeller
Adds a new product by a seller.- Parameters:
product
- The product object to add.- Returns:
true
if the product was successfully added,false
otherwise.
-
getProductIdByCategoryName
Retrieves the product ID based on the category name.- Parameters:
categoryName
- The name of the category.- Returns:
- The product ID associated with the category.
-
returnProduct
Processes the return of a product.- Parameters:
returnProduct
- The return product object.- Returns:
true
if the return was successfully processed,false
otherwise.
-