Interface CustomerReviewDao
- All Known Implementing Classes:
DefaultCustomerReviewDao
public interface CustomerReviewDao
Data Access Object for
CustomerReviewModel-
Method Summary
Modifier and TypeMethodDescriptiongetAverageRating(ProductModel product) Calculates the average rating for a product.getNumberOfReviews(ProductModel product) Get number of all reviews in any language for the specified product.getReviewsForCustomer(UserModel userModel) Get the reviews for the specified customer.getReviewsForProduct(ProductModel product) Get the reviews for the specified product.getReviewsForProductAndLanguage(ProductModel product, LanguageModel language) Get the reviews for the specified product in the specified language.
-
Method Details
-
getReviewsForProduct
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 productlanguage- the language- Returns:
- the reviews
-
getReviewsForCustomer
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
Get number of all reviews in any language for the specified product.- Parameters:
product- the product- Returns:
- the number of reviews
-
getAverageRating
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
-