Class ReviewService

java.lang.Object
com.esprit.services.products.ReviewService
All Implemented Interfaces:
IService<Review>

public class ReviewService extends Object implements IService<Review>
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • connection

      private final Connection connection
  • Constructor Details

    • ReviewService

      public ReviewService()
      Performs ReviewService operation.
  • Method Details

    • create

      public void create(Review review)
      Specified by:
      create in interface IService<Review>
    • read

      public List<Review> read()
      Specified by:
      read in interface IService<Review>
    • update

      public void update(Review review)
      Specified by:
      update in interface IService<Review>
    • delete

      public void delete(Review review)
      Specified by:
      delete in interface IService<Review>
    • getAverageRating

      public double getAverageRating(Long productId)
      Retrieves the AverageRating value.
      Returns:
      the AverageRating value
    • getAverageRatingSorted

      public List<Review> getAverageRatingSorted()
      Retrieves the AverageRatingSorted value.
      Returns:
      the AverageRatingSorted value
    • ratingExists

      public Review ratingExists(Long productId, Long userId)
      Performs ratingExists operation.
      Returns:
      the result of the operation