Search in sources :

Example 1 with ReviewFeedback

use of org.broadleafcommerce.core.rating.domain.ReviewFeedback in project BroadleafCommerce by BroadleafCommerce.

the class RatingServiceImpl method markReviewHelpful.

@Override
@Transactional("blTransactionManager")
public void markReviewHelpful(Long reviewId, Customer customer, Boolean helpful) {
    ReviewDetail reviewDetail = reviewDetailDao.readReviewDetailById(reviewId);
    if (reviewDetail != null) {
        ReviewFeedback reviewFeedback = reviewDetailDao.createFeedback();
        reviewFeedback.setCustomer(customer);
        reviewFeedback.setIsHelpful(helpful);
        reviewFeedback.setReviewDetail(reviewDetail);
        reviewDetail.getReviewFeedback().add(reviewFeedback);
        reviewDetailDao.saveReviewDetail(reviewDetail);
    }
}
Also used : ReviewDetail(org.broadleafcommerce.core.rating.domain.ReviewDetail) ReviewFeedback(org.broadleafcommerce.core.rating.domain.ReviewFeedback) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ReviewDetail (org.broadleafcommerce.core.rating.domain.ReviewDetail)1 ReviewFeedback (org.broadleafcommerce.core.rating.domain.ReviewFeedback)1 Transactional (org.springframework.transaction.annotation.Transactional)1