Hql查询

来源:互联网 发布:linux的vim命令 编辑:程序博客网 时间:2024/06/02 18:20
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;}

原创粉丝点击