栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

nested exception is org.hibernate.PropertyValueException: not-null property references a null or tr

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

nested exception is org.hibernate.PropertyValueException: not-null property references a null or tr

今天在写更新sql 时遇到了这么一个问题,字段数据库设置的是可以为空的,但是新增时却提示字段为空

1647223985813317]/[quan11]:com.isoftstone.fwk.service.BusinessServiceException: com.isoftstone.fwk.dao.DaoException: ; nested exception is com.isoftstone.fwk.dao.DaoException: 批量保存或更新集合里的Hibernate对象出错:[[com.isoftstone.pcis.reinsure.vo.RiShareBillVO@77ea84d7, com.isoftstone.pcis.reinsure.vo.RiShareBillVO@5dbf8a81, com.isoftstone.pcis.reinsure.vo.RiShareBillVO@439c0a6e]]; nested exception is org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: com.isoftstone.pcis.reinsure.vo.RiShareBillVO.CFinSettMrk; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: com.isoftstone.pcis.reinsure.vo.RiShareBillVO.CFinSettMrk
at com.isoftstone.pcis.reinsure.dm.fac.RiFacBidMainDao.saveOrUpdateAll(RiFacBidMainDao.java:1067)
at com.isoftstone.pcis.reinsure.service.fac.RiFacBidMainService.createFacOuterBill(RiFacBidMainService.java:3268)
at com.isoftstone.pcis.reinsure.service.fac.RiFacBidMainService.genFacAcc(RiFacBidMainService.java:2626)
at com.isoftstone.pcis.reinsure.bm.fac.RiFacBidMainBizAction.genFacAcc(RiFacBidMainBizAction.java:2489)、、

原因是因为在hibernate的配置文件中设置了非空校验

删除 not-null =“true” 就可以保存成功了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/763041.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号