Package com.masai.Dao
Class TransactionDaoImpl
java.lang.Object
com.masai.Dao.TransactionDaoImpl
- All Implemented Interfaces:
TransactionDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalreadyReturnOrNot(int transactionId) Retrieves the return type for a given transaction ID.getAllTransactionIdByParticularBuyer(String buyerUsername) Retrieves all transaction IDs associated with a particular buyer.Retrieves the product name, product ID, quantity, and date of a transaction by its ID and return status.booleanreturnProductTransaction(ReturnProduct returnProduct) Processes the return of a product as a transaction.
-
Constructor Details
-
TransactionDaoImpl
public TransactionDaoImpl()
-
-
Method Details
-
getAllTransactionIdByParticularBuyer
Retrieves all transaction IDs associated with a particular buyer.- Specified by:
getAllTransactionIdByParticularBuyerin interfaceTransactionDao- Parameters:
buyerUsername- The username of the buyer.- Returns:
- A list of transaction IDs.
-
getProductNameAndProductIdAndQuantityAndDateByIdAndReturn
Retrieves the product name, product ID, quantity, and date of a transaction by its ID and return status.- Specified by:
getProductNameAndProductIdAndQuantityAndDateByIdAndReturnin interfaceTransactionDao- Parameters:
id- The ID of the transaction.- Returns:
- A list containing the product name, product ID, quantity, and date.
-
returnProductTransaction
Processes the return of a product as a transaction.- Specified by:
returnProductTransactionin interfaceTransactionDao- Parameters:
returnProduct- The return product object.- Returns:
trueif the return transaction was successfully processed,falseotherwise.
-
alreadyReturnOrNot
Retrieves the return type for a given transaction ID.- Specified by:
alreadyReturnOrNotin interfaceTransactionDao- Parameters:
transactionId- The transaction ID to check for return status.- Returns:
- The return type ("YES" or "NO") for the specified transaction ID.
-