第一种:
Query query = getSession().createQuery("from Company m where m.companyName like '%'||:name||'%' ");
query.setParameter("name", param);
第二种:
Query query = getSession().createQuery("from Company m where m.companyName like :name ");
query.setParameter("name", "%"+param+"%");