HQL查询语句中的模糊查询

From  Person this Where this.name like '%abc%'
@SuppressWarnings("unchecked")
    @Override
    public List<ReportLog> query(String type) {
        return getSession().createQuery(" from Person this WHERE this.name like :type ")
                .setParameter("type", "%"+type+"%")
                .list();
    }
原文地址:https://www.cnblogs.com/liaojie970/p/5106166.html