String hql = "from Stock s where s.stockCode = '" + stockCode + "'"; List result = session.createQuery(hql).list();