hibernate-hql查询

select可以省略,但不建议这么做,尽量做到查询精确。 hql是面向对象的不管返回值还是条件都是对对象而言,不是数据库表。数据库中的一条记录就是一个对象。 1、根据条件查询某个具体对象 Student s = (Student) session.createQuery("select s from Student s where s.id=2").uniqueResult(); uniqueRe
相关文章
相关标签/搜索