Hibernate使用like模糊查询

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模糊查询)