当前位置: 代码迷 >> Java Web开发 >> 关于异常:attempt to create delete event with null entity
  详细解决方案

关于异常:attempt to create delete event with null entity

热度:2993   发布时间:2013-02-25 21:20:29
关于错误:attempt to create delete event with null entity
UserDaoImpl.java中相关代码
Java code
 public void delete(int id) {     [color=#FF0000] this.getHibernateTemplate().delete(this.getUserInfo(id)) ;[/color]     }

UserManagerServiceImpl.java中相关代码
Java code
public void deleteUser(int id) {                [color=#FF0000]this.userDao.delete(id);[/color]            }            public UserInfo getUser(int id) {                return this.userDao.getUserInfo(id);            }

ZspAction.java中相关代码
Java code
 public String delete() {                 UserManagerService b= (UserManagerService) DefaultBeanFactory.getBean("UserManagerService");               if (this.name !=" ") {              [color=#FF0000] b.deleteUser(this.id);[/color]              } else {               if (ids.length > 0) {                for (int id : ids) {                 b.deleteUser(id);                }               }              }              if (b.listUser().size() > 0) {                  return "list_delete";                //  return SUCCESS;              } else {               return INPUT;              }             }


红色的为报错的行,我是新手,貌似错误很多,希望高手指点。

------解决方案--------------------------------------------------------
(this.id)这个有值吗?说你删除一条不存在的记录··
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!