Interface CustomerReviewDao
-
- All Known Implementing Classes:
DefaultCustomerReviewDao
public interface CustomerReviewDaoData Access Object forCustomerReviewModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.DoublegetAverageRating(ProductModel product)Calculates the average rating for a product.java.lang.IntegergetNumberOfReviews(ProductModel product)Get number of all reviews in any language for the specified product.java.util.List<CustomerReviewModel>getReviewsForCustomer(UserModel userModel)Get the reviews for the specified customer.java.util.List<CustomerReviewModel>getReviewsForProduct(ProductModel product)Get the reviews for the specified product.java.util.List<CustomerReviewModel>getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)Get the reviews for the specified product in the specified language.
-
-
-
Method Detail
-
getReviewsForProduct
java.util.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
java.util.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
java.util.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
java.lang.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
java.lang.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
-
-