执行删除的时候页面报错
org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: java.util.ArrayList; nested exception is org.hibernate.MappingException: Unknown entity: java.util.ArrayList
我的用了三层架构跟三大框架,具体删除代码如下:
public void deleteEmployee(String[] employeeId) {
List<Employee> entities = new ArrayList<Employee>();
HibernateTemplate hibernateTemplate = this.getHibernateTemplate();
for (String eid : employeeId) {
entities.add((Employee) hibernateTemplate.load(Employee.class,
Integer.valueOf(eid)));
}
hibernateTemplate.delete(entities);
this.getSession().beginTransaction().commit();
}
执行后后台输出执行SQL语句如下:
Hibernate: select this_.id as id0_0_, this_.code as code0_0_, this_.name as name0_0_, this_.birthday as birthday0_0_, this_.sex as sex0_0_, this_.telephone as telephone0_0_, this_.email as email0_0_ from employee this_
Hibernate: select employee0_.id as id0_0_, employee0_.code as code0_0_, employee0_.name as name0_0_, employee0_.birthday as birthday0_0_, employee0_.sex as sex0_0_, employee0_.telephone as telephone0_0_, employee0_.email as email0_0_ from employee employee0_ where employee0_.id=?