在用到Spring和Hibernate开发时,update的时候就会报这个错误 意思好像就是有的属性不能为空 我的可能有的为空了,后来看了别的高手的回答,好像是更新时没有把对象的id传过去,所以报错,我将id隐藏的放在input中就ok了
org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: xml.dao.info.InfoRebate; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: xml.dao.info.InfoRebate
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at
org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: xml.dao.info.InfoRebate; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: xml.dao.info.InfoRebate
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at
本文探讨了在使用Spring和Hibernate进行开发时遇到的更新操作报错问题,具体表现为对象标识符为空导致的异常。文章提供了排查及修复该问题的方法,包括确保对象ID在更新时被正确传递。
1027

被折叠的 条评论
为什么被折叠?



