public void deleteDeviceApply(String strformguid){
String hql = "from Ybdeviceapplyform where strformguid = \'"+strformguid+"\'";
Ybdeviceapplyform yb = (Ybdeviceapplyform) getHibernateTemplate().find(hql).get(0);
getHibernateTemplate().delete(yb);
}
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
我得到一个id然后查出那个对象再删除,为什么会报数组越界?
------解决方案--------------------
getHibernateTemplate().find(hql) 没有数据....调用list.get(0) 就出错,越界了