Class DefaultCustomerReviewDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
-
- de.hybris.platform.customerreview.dao.impl.DefaultCustomerReviewDao
-
- All Implemented Interfaces:
CustomerReviewDao,Dao
public class DefaultCustomerReviewDao extends AbstractItemDao implements CustomerReviewDao
Default implementation ofCustomerReviewDao
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomerReviewDao()
-
Method Summary
All Methods Instance Methods Concrete 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 customer)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.-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
-
-
-
Method Detail
-
getReviewsForProduct
public java.util.List<CustomerReviewModel> getReviewsForProduct(ProductModel product)
Description copied from interface:CustomerReviewDaoGet 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.- Specified by:
getReviewsForProductin interfaceCustomerReviewDao- Parameters:
product- the product- Returns:
- the reviews
-
getReviewsForProductAndLanguage
public java.util.List<CustomerReviewModel> getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)
Description copied from interface:CustomerReviewDaoGet the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.- Specified by:
getReviewsForProductAndLanguagein interfaceCustomerReviewDao- Parameters:
product- the productlanguage- the language- Returns:
- the reviews
-
getReviewsForCustomer
public java.util.List<CustomerReviewModel> getReviewsForCustomer(UserModel customer)
Description copied from interface:CustomerReviewDaoGet 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.- Specified by:
getReviewsForCustomerin interfaceCustomerReviewDao- Parameters:
customer- the customer- Returns:
- the reviews
-
getNumberOfReviews
public java.lang.Integer getNumberOfReviews(ProductModel product)
Description copied from interface:CustomerReviewDaoGet number of all reviews in any language for the specified product.- Specified by:
getNumberOfReviewsin interfaceCustomerReviewDao- Parameters:
product- the product- Returns:
- the number of reviews
-
getAverageRating
public java.lang.Double getAverageRating(ProductModel product)
Description copied from interface:CustomerReviewDaoCalculates the average rating for a product.- Specified by:
getAverageRatingin interfaceCustomerReviewDao- Parameters:
product- the Product for which the average rating shall be calculated- Returns:
- the average of all ratings for the given product
-
-