Package com.manager

Class DB2024TEAM07_ReviewManager

java.lang.Object
com.manager.DB2024TEAM07_ReviewManager

public class DB2024TEAM07_ReviewManager extends Object
This class manages review functionalities in the E-MATEASY application. It provides methods for adding, updating, deleting, and retrieving reviews from the database.
  • Field Details

  • Constructor Details

    • DB2024TEAM07_ReviewManager

      public DB2024TEAM07_ReviewManager()
  • Method Details

    • addReview

      public static void addReview(Scanner scanner)
      Adds a new review to the database for a specific restaurant and menu item.
      Parameters:
      scanner - a Scanner object to read user input
    • updateReview

      public static void updateReview(Scanner scanner)
      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

      public static void getReview(Scanner scanner)
      Retrieves a page of reviews from the database.
      Parameters:
      scanner - a Scanner object to read user input
    • getUserCount

      public static void getUserCount(Scanner scanner)
      Retrieves the total number of reviews for a specific user.
      Parameters:
      scanner - a Scanner object to read user input
    • getUserReview

      public static void getUserReview(Scanner scanner)
      Retrieves a page of reviews for a specific user from the database.
      Parameters:
      scanner - a Scanner object to read user input
    • getResCount

      public static void getResCount(Scanner scanner)
      Retrieves the total number of reviews for a specific restaurant.
      Parameters:
      scanner - a Scanner object to read user input
    • getResReview

      public static void getResReview(Scanner scanner)
      Retrieves a page of reviews for a specific restaurant from the database.
      Parameters:
      scanner - a Scanner object to read user input
    • deleteReview

      public static void deleteReview(Scanner scanner)
      Deletes a review from the database.
      Parameters:
      scanner - a Scanner object to read user input
    • getResIdForReview

      private static int getResIdForReview(Connection conn, int reviewId)
      Helper method to retrieve the restaurant ID associated with a review from the database.
      Parameters:
      conn - a Connection object representing the database connection
      reviewId - the ID of the review
      Returns:
      the restaurant ID or -1 if not found