hibernate之hql

1.hql查詢count函數如何實現
String hql="from Class where d.id<=1 and d.userNum= 100002 THEN 1 else null end "
List case=session.createQuery(hql).list();
int count=case.size();
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章