详细解决方案
关于异常:attempt to create delete event with null entity
热度:2993 发布时间:2013-02-25 21:20:29
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)这个有值吗?说你删除一条不存在的记录··
相关解决方案
- struts2 对象属性流入不进去, 报错:target is null for setProperty(null, "x" [Ljava.lang.Stri
- import cn.luxh.struts2.entity.Novel 急需的jar包是哪个
- SSH有关问题,There is no Action 地图ped for action name null
- struts+spring+mybatis出现错误(java.lang.ClassNotFoundException: Entity)为提示位置
- GWT 报错,能的请进: com.google.gwt.event.shared.UmbrellaException: Exception caught: Se
- !使用JDNI时,报 Cannot create JDBC driver of class '' for connect URL 'null'
- java.util.ArrayList cannot be cast to com.hxll.hr.entity.SalaryStandard解决方法
- java.sql.SQLException: The url cannot be null 谋求帮助
- 关于for循环中delete 跟 拼接sql delete table in ()的效率比较?
- getHibernateTemplate().get(entity.Class,serializabel id) 如何报java.lang.NullPointerException的错误
- 急org.hibernate.MappingException: Unknown entity
- null id in com.bsw.gms.hibernate.pojo.Score entry (don't flush the Session after an exception occurs,该怎么解决
- Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPe解决方法
- hibernate报Illegal attempt to associate a collection with
- 急紧急十分紧急JSP,「focus="<%= JspUtil.getFirstProperty(request, null) %>」哪位高手给解释上这句话的作用?一有答案立即结帖
- ognl.OgnlException: target is null for setProperty,该怎么解决
- 关于异常:attempt to create delete event with null entity
- log4j:ERROR setFile(null,false) call failed.解决方法
- org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: Use,该怎么解决
- Cannot create a session after the response has been committed,该怎么解决
- 'null' 为空或不是对象?该怎么处理
- struts2开发时出现的异常 Exception sending context initialized event to listener instance
- org.hibernate.PropertyAccessException: Null value was assigned to a property of解决办法
- java.lang.OutOfMemoryError: unable to create new native thread内存泄漏分析-备忘解决办法
- null == a 和 a == null 的区别,该怎么处理
- org.apache.jasper.JasperException: java.lang.NumberFormatException: null,该怎么解决
- null == a 跟 a == null 的区别
- org.apache.jasper.JasperException: java.lang.NumberFormatException: null,该如何解决
- Cannot create a session after the response has been committed解决办法
- hibernate 如何使用原始的SQL 语句进行insert update delete 操作