Package com.masai.Dao
Interface AdminDao
- All Known Implementing Classes:
AdminDaoImpl
public interface AdminDao
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve all active buyers.Retrieve all products.getAllProductsByCategory(String CatName) Retrieve all products belonging to a specific category.Retrieve all products sorted in ascending order of price.getAllProductsByQuantity(int from, int to) Retrieve all products within a specified quantity range.getAllProductsBySellerUsername(String username) Retrieve all products belonging to a specific seller's username.Retrieve all active sellers.Retrieve all sold products.Retrieve all transactions.getAllTransactionbyDateRange(LocalDate startDate, LocalDate endDate) Retrieve all transactions within a specific date range.Retrieve all transactions sorted by GST percentage.Retrieve all transactions sorted by purchase date.Retrieve all transactions sorted by quantity.Retrieve all transactions sorted by total price.getTransactionById(int id) Retrieve a transaction by its ID.loginAdmin(String adminId, String password) Login as an admin.
-
Method Details
-
loginAdmin
Login as an admin.- Parameters:
adminId- The admin ID.password- The admin password.- Returns:
- True if the login is successful, False otherwise.
- Throws:
InvalidCredentialsException- If the admin ID or password is invalid.
-
getAllBuyer
Retrieve all active buyers.- Returns:
- A ResultSet containing information about all active buyers.
- Throws:
RecordNotFoundException- If no active buyers are found.
-
getAllSeller
ResultSet getAllSeller()Retrieve all active sellers.- Returns:
- A ResultSet containing information about all active sellers.
- Throws:
RecordNotFoundException- If no active sellers are found.
-
getAllProducts
Retrieve all products.- Returns:
- A ResultSet containing information about all products.
- Throws:
RecordNotFoundException- If no products are found.
-
getAllSoldProducts
Retrieve all sold products.- Returns:
- A ResultSet containing information about all sold products.
- Throws:
RecordNotFoundException- If no sold products are found.
-
getAllProductsByCategory
Retrieve all products belonging to a specific category.- Parameters:
categoryName- The name of the category.- Returns:
- A ResultSet containing information about all products in the specified category.
- Throws:
RecordNotFoundException- If no products are found in the specified category.
-
getAllProductsBySellerUsername
Retrieve all products belonging to a specific seller's username.- Parameters:
username- The username of the seller.- Returns:
- A ResultSet containing information about all products belonging to the specified seller.
- Throws:
RecordNotFoundException- If no products are found for the specified seller.
-
getAllProductsByInAccendingOrderByPrice
Retrieve all products sorted in ascending order of price.- Returns:
- A ResultSet containing information about all products sorted by price in ascending order.
- Throws:
RecordNotFoundException- If no products are found.
-
getAllProductsByQuantity
Retrieve all products within a specified quantity range.- Parameters:
from- The minimum quantity.to- The maximum quantity.- Returns:
- A ResultSet containing information about all products within the specified quantity range.
- Throws:
RecordNotFoundException- If no products are found within the specified quantity range.
-
getAllTransaction
Retrieve all transactions.- Returns:
- A ResultSet containing information about all transactions.
- Throws:
RecordNotFoundException- If no transactions are found.
-
getAllTransactionbyDateRange
ResultSet getAllTransactionbyDateRange(LocalDate startDate, LocalDate endDate) throws RecordNotFoundException Retrieve all transactions within a specific date range.- Parameters:
startDate- The start date of the range.endDate- The end date of the range.- Returns:
- A ResultSet containing information about all transactions within the specified date range.
- Throws:
RecordNotFoundException- If no transactions are found within the specified date range.
-
getTransactionById
Retrieve a transaction by its ID.- Parameters:
id- The ID of the transaction.- Returns:
- A ResultSet containing information about the transaction with the specified ID.
- Throws:
RecordNotFoundException- If no transaction is found with the specified ID.
-
getAllTransactionByPurchaseDate
Retrieve all transactions sorted by purchase date.- Returns:
- A ResultSet containing information about all transactions sorted by purchase date.
- Throws:
RecordNotFoundException- If no transactions are found.
-
getAllTransactionByQuantity
Retrieve all transactions sorted by quantity.- Returns:
- A ResultSet containing information about all transactions sorted by quantity.
- Throws:
RecordNotFoundException- If no transactions are found.
-
getAllTransactionByGSTPercentage
Retrieve all transactions sorted by GST percentage.- Returns:
- A ResultSet containing information about all transactions sorted by GST percentage.
- Throws:
RecordNotFoundException- If no transactions are found.
-
getAllTransactionByTotalPrice
Retrieve all transactions sorted by total price.- Returns:
- A ResultSet containing information about all transactions sorted by total price.
- Throws:
RecordNotFoundException- If no transactions are found.
-