Hql查询

public List<Student> findStudent(String stuNo,String stuName){
	String hql = "from Student t where t.stuNo =: stuNo and t.stuName =: stuName ";
	Query query = sessionFactory.getCurrentSession().createQuery(hql);
	query.setParameter("stuNo",stuNo);
	query.setParameter("stuName",stuName);
	List<Student> list = query.list();
	return list;
}

原文地址:https://www.cnblogs.com/hzcya1995/p/13315696.html