Hql查询
程序员文章站
2022-04-15 22:53:34
...
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;
}
上一篇: hibernate中inverse和cascade应用总结
下一篇: HQL多表查询语法(不常用)