HTTP Status 500 - Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updateorg.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException:对表中数据进行更新时,更新成功了,但是页面出现这样的错误。要更新的这张表与其他表有关联关系。上午调试了一上午,调不出个结果来。各位帮忙看看Hibernate
没有在表中设置关联关系,在实体bean的xml中配置的多对多关系
检查一下你的hibernate配置文件hbm.xml里面和数据库对应吗?属性配置是否正确
本来就是加的级联关系,这样弄了数据确实更新了。但是页面报的就是上面的错误。如果让cascade="none",就不报错了。但是并没有更新与其他表关联的数据。数据丢失了。