67,512
社区成员
发帖
与我相关
我的任务
分享
private String hql = "select sum(TOTAL_TICKETS) from VoteTeacher";
public long getTeacherListMaxSize(final String hql) {
long size = 0;
try {
size = (Long) this.getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Query query = session.createQuery(hql);
Long size = (Long) query.list().get(0);
return size;
}
});
} catch (Exception e) {
}
return size;
}
private String hql = "select count(TOTAL_TICKETS) from VoteTeacher";