Interface CustomerReviewDao

All Known Implementing Classes:
DefaultCustomerReviewDao

public interface CustomerReviewDao
Data Access Object for CustomerReviewModel
  • Method Details

    • getReviewsForProduct

      List<CustomerReviewModel> getReviewsForProduct(ProductModel product)
      Get the reviews for the specified product. Gets all the reviews in any language. The reviews are ordered by creation date with the most recent first.
      Parameters:
      product - the product
      Returns:
      the reviews
    • getReviewsForProductAndLanguage

      List<CustomerReviewModel> getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)
      Get the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.
      Parameters:
      product - the product
      language - the language
      Returns:
      the reviews
    • getReviewsForCustomer

      List<CustomerReviewModel> getReviewsForCustomer(UserModel userModel)
      Get the reviews for the specified customer. Gets all the reviews in any language. The reviews are ordered by created date with the most recent first.
      Parameters:
      userModel - the customer
      Returns:
      the reviews
    • getNumberOfReviews

      Integer getNumberOfReviews(ProductModel product)
      Get number of all reviews in any language for the specified product.
      Parameters:
      product - the product
      Returns:
      the number of reviews
    • getAverageRating

      Double getAverageRating(ProductModel product)
      Calculates the average rating for a product.
      Parameters:
      product - the Product for which the average rating shall be calculated
      Returns:
      the average of all ratings for the given product