@Override
	@Transactional
	public List<MerchantReview> getFilterReviews(int merchantId, int userId,
			int reviewId) throws Exception {

		List<MerchantReview> merchantReviewList = new ArrayList<MerchantReview>();
		Query query = null;
		try {
			if (merchantId != 0) {
				
				System.out.println("<---------based on merchant name-------------->");
				
				query = sessionFactory
						.getCurrentSession()
						.createQuery(
								"from MerchantReview merchantReview where"
										+ " merchantReview.oMerchant.iMerchantId=:merchantid");
				query.setParameter("merchantid", merchantId);
			} else if (userId != 0) {
				System.out.println("<---------based on user name-------------->");
				query = sessionFactory
						.getCurrentSession()
						.createQuery(
								"from MerchantReview merchantReview where"
										+ " merchantReview.oCashBackUser.iCashBackUserId=:userId");
				query.setParameter("userId", userId);
			}
			else
			{
				System.out.println("<---------based on review status-------------->");
				query = sessionFactory
						.getCurrentSession()
						.createQuery(
								"from MerchantReview merchantReview where"
										+ " merchantReview.oStatus.iMerchantReviewStatusId=:reviewStatusId");
				query.setParameter("reviewStatusId", reviewId);
			}

			merchantReviewList = query.list();
			Iterator<MerchantReview> iterator = merchantReviewList.iterator();
			while (iterator.hasNext()) {
				MerchantReview merchantReview = iterator.next();
				System.out.println("merchant review" + merchantReview);
			}

		} catch (Exception exception) {
			throw exception;
		}
		return merchantReviewList;
	}