org.hibernate.MappingException: Unknown entity: java.util.ArrayList问题求解决

y_Rime 2015-06-15 05:49:47
执行删除的时候页面报错
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=?
...全文
517 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
业余草 2015-06-15
  • 打赏
  • 举报
回复

10,608

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧