?public boolean runByHql(String hql, Object...params) {
try {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery(hql);
if(params != null && params.length>0){
for(int i=0;i<params.length;i++){
query.setString(i, params[i].toString());
}
}
query.executeUpdate();
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
?String hql = "delete Lc_Admin where id in(?)";
为什么执行此条hql语句时,能执行成功。但是删除多个id时[1,2,3],只能执行成功一个id的数据[1]!!!
------解决思路----------------------
发到java版块吧,这个版块是pb的