String hql = "from User where userName like ? and realName like ?";
Query query = session.createQuery(hql);
query.setParameter(0, "%" + userName + "%");
query.setParameter(1, "%" + realName + "%");
Hibernate使用like模糊查询
最新推荐文章于 2021-01-27 00:10:20 发布