@SuppressWarnings("unchecked")
	@Transactional
	public List<Merchant> getMerchantList(String merchantName,String sortBy,String sortOrder) throws Exception
	{
		List<Merchant> lstMerchants = new ArrayList<Merchant>();
		Session session = null;
		Criteria criteriaObj = null;
		logger.info("merchantName---------->"+merchantName);
		logger.info("sortBy--------------->"+sortBy);
		logger.info("sortOrder------------>"+sortOrder);
		String sName = merchantName;
		try
		{

			session = sessionFactory.getCurrentSession();

			logger.info("Entered into getMerchantList()--->");

			logger.info("Retrieving all merchants");

			if(session != null)
			{
				// Create a Hibernate query (HQL)

				criteriaObj = session.createCriteria(Merchant.class);

				if(merchantName != null)
				{
					logger.info("Retrieving  merchants based on name");
					criteriaObj.add(Restrictions.ilike("sName", "%"+sName+"%"));
					criteriaObj.add(Restrictions.eq("bdeletedFlag", false));
				}
				lstMerchants = criteriaObj.list();
				logger.info("lstMerchants from DAO----------->"+lstMerchants.size());

			}
			
			if(sortBy != null && sortOrder == "asc")	
			{
				logger.info("Retrieving  merchants based on Ascending sort order for "+sortBy);
				lstMerchants = criteriaObj.addOrder(Order.asc(sortBy)).list();
				logger.info("lstMerchants size-------->"+lstMerchants.size());
			}
			if(sortBy != null && sortOrder == "desc")	
			{
				logger.info("Retrieving  merchants based on Descending sort order for "+sortBy);
				lstMerchants = criteriaObj.addOrder(Order.desc(sortBy)).list();
				logger.info("lstMerchants size-------->"+lstMerchants.size());
			}
			Iterator<Merchant> it = lstMerchants.iterator();
			while(it.hasNext())
			{
				Merchant merchant=it.next();
				System.out.println("dao......."+merchant);
			}
		}

		catch(Exception e)
		{
			e.printStackTrace();
			logger.error("Exception occured in getMerchantList()--->"+e.getMessage());
			throw new Exception("Exception occured in getMerchantList()--->"+e.getMessage());
		}
		return lstMerchants;

	}