hibernate-hql查詢

select可以省略,但不建議這麼做,儘量做到查詢精確。 hql是面向對象的不管返回值還是條件都是對對象而言,不是數據庫表。數據庫中的一條記錄就是一個對象。 1、根據條件查詢某個具體對象 Student s = (Student) session.createQuery("select s from Student s where s.id=2").uniqueResult(); uniqueRe
相關文章
相關標籤/搜索