struts+hibernate 错误 public void dellUser(int[] id) { StringBuffer sb = new StringBuffer(); for(int i = 0;i<id.length;i++){ sb.append(id[i]); sb.append(","); } String hql = "from User u where u.id in ( "+sb.substring(0,sb.length()-1)+")";
Query query = session.createQuery(hql);
List dellUserList= query.list(); for (int i = 0;i<dellUserList.size();i++){ System.out.println(dellUserList.get(i)+" ====="); this.getHibernateTemplate().delete(dellUserList.get(i)); }