日期:2014-05-17  浏览次数:20631 次

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