DetachedCriteria detachedCriteria = DetachedCriteria.forClass(User.class);
detachedCriteria.add(Restrictions.eq("userName", userName));
List<User> criteria = this.getHibernateTemplate().findByCriteria(detachedCriteria);
detachedCriteria.add(Restrictions.eq("userName", userName));
List<User> criteria = this.getHibernateTemplate().findByCriteria(detachedCriteria);
return criteria;
detachedCriteria.add(Restrictions.eq("userName", userName));这句代码,都是按条件查询为什么eq好用,但是like就不好用呢?