首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2012-05-15 
关于错误:attempt to create delete event with null entityUserDaoImpl.java中相关代码Java code public

关于错误: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)这个有值吗?说你删除一条不存在的记录··

热点排行