Package com.manager
Class DB2024TEAM07_ReviewManager
java.lang.Object
com.manager.DB2024TEAM07_ReviewManager
This class manages review functionalities in the E-MATEASY application.
It provides methods for adding, updating, deleting, and retrieving reviews
from the database.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static intprivate static DB2024TEAM07_RatingDAOprivate static DB2024TEAM07_ReviewDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds a new review to the database for a specific restaurant and menu item.static voiddeleteReview(Scanner scanner) Deletes a review from the database.static voidgetCount()Retrieves the total number of reviews in the database.static voidgetResCount(Scanner scanner) Retrieves the total number of reviews for a specific restaurant.private static intgetResIdForReview(Connection conn, int reviewId) Helper method to retrieve the restaurant ID associated with a review from the database.static voidgetResReview(Scanner scanner) Retrieves a page of reviews for a specific restaurant from the database.static voidRetrieves a page of reviews from the database.static voidgetUserCount(Scanner scanner) Retrieves the total number of reviews for a specific user.static voidgetUserReview(Scanner scanner) Retrieves a page of reviews for a specific user from the database.static voidupdateReview(Scanner scanner) Updates an existing review in the database.
-
Field Details
-
reviewDAO
-
ratingDAO
-
page
private static int page
-
-
Constructor Details
-
DB2024TEAM07_ReviewManager
public DB2024TEAM07_ReviewManager()
-
-
Method Details
-
addReview
Adds a new review to the database for a specific restaurant and menu item.- Parameters:
scanner- a Scanner object to read user input
-
updateReview
Updates an existing review in the database.- Parameters:
scanner- a Scanner object to read user input
-
getCount
public static void getCount()Retrieves the total number of reviews in the database. -
getReview
Retrieves a page of reviews from the database.- Parameters:
scanner- a Scanner object to read user input
-
getUserCount
Retrieves the total number of reviews for a specific user.- Parameters:
scanner- a Scanner object to read user input
-
getUserReview
Retrieves a page of reviews for a specific user from the database.- Parameters:
scanner- a Scanner object to read user input
-
getResCount
Retrieves the total number of reviews for a specific restaurant.- Parameters:
scanner- a Scanner object to read user input
-
getResReview
Retrieves a page of reviews for a specific restaurant from the database.- Parameters:
scanner- a Scanner object to read user input
-
deleteReview
Deletes a review from the database.- Parameters:
scanner- a Scanner object to read user input
-
getResIdForReview
Helper method to retrieve the restaurant ID associated with a review from the database.- Parameters:
conn- a Connection object representing the database connectionreviewId- the ID of the review- Returns:
- the restaurant ID or -1 if not found
-