67,538
社区成员
发帖
与我相关
我的任务
分享
public int getCount(String condi1, String condi2) {
getHibernateTemplate().executeFind(new HibernateCallback() {
public Object doInHibernate(Session s) throws HibernateException,
SQLException {
String q = "select count(id) from Table where " + condition1
+ "=" + condi1;
Query query = s.createQuery(q);
return (Integer) query.uniqueResult();
}
});
return 0;
}
public int getCount(String condi1, String condi2) {
return (Integer)getHibernateTemplate().executeFind(new HibernateCallback() {
public Object doInHibernate(Session s) throws HibernateException,
SQLException {
String q = "select count(id) from Table where " + condition1
+ "=" + condi1;
Query query = s.createQuery(q);
return query.uniqueResult();
}
});
}