Class DefaultCustomerReviewDao

    • Constructor Detail

      • DefaultCustomerReviewDao

        public DefaultCustomerReviewDao()
    • Method Detail

      • getReviewsForProduct

        public java.util.List<CustomerReviewModel> getReviewsForProduct​(ProductModel product)
        Description copied from interface: CustomerReviewDao
        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.
        Specified by:
        getReviewsForProduct in interface CustomerReviewDao
        Parameters:
        product - the product
        Returns:
        the reviews
      • getReviewsForCustomer

        public java.util.List<CustomerReviewModel> getReviewsForCustomer​(UserModel customer)
        Description copied from interface: CustomerReviewDao
        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.
        Specified by:
        getReviewsForCustomer in interface CustomerReviewDao
        Parameters:
        customer - the customer
        Returns:
        the reviews
      • getNumberOfReviews

        public java.lang.Integer getNumberOfReviews​(ProductModel product)
        Description copied from interface: CustomerReviewDao
        Get number of all reviews in any language for the specified product.
        Specified by:
        getNumberOfReviews in interface CustomerReviewDao
        Parameters:
        product - the product
        Returns:
        the number of reviews
      • getAverageRating

        public java.lang.Double getAverageRating​(ProductModel product)
        Description copied from interface: CustomerReviewDao
        Calculates the average rating for a product.
        Specified by:
        getAverageRating in interface CustomerReviewDao
        Parameters:
        product - the Product for which the average rating shall be calculated
        Returns:
        the average of all ratings for the given product