public int find2(String hql){
final String hql1 = hql;
try{
this.getHibernateTemplate().execute(new HibernateCallback(){
//执行查询操作
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
list = session.createQuery(hql1).list();
return list;
}
});
int num=(Integer) list.get(0);
return num;
}catch(Exception e){
e.printStackTrace();
return 0;
}
} 详细解决方案
hql中会合函数查询
热度:514 发布时间:2013-09-09 20:31:09.0
相关解决方案