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