ibatis 映射 自动装箱,解箱缺陷

来源:互联网 发布:易语言自动填表源码 编辑:程序博客网 时间:2024/06/13 11:13

com.yuwang.crm.core.DaoException: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in sqlmap/sales/item-xiangou-sqlmap.xml. 
--- The error occurred while applying a result map. 
--- Check the ItemXianGou.itemXianGouMap. 
--- The error happened while setting a property on the result object. 
--- Cause: java.lang.RuntimeException: Error setting property 'setBatchNum' of 'com.yuwang.crm.model.sales.ItemXianGouDO@1c114f0'.  Cause: java.lang.IllegalArgumentException

新增数据时,发现ibatis映射没有任何问题,但是更新原有的数据确实老报错,仔细检查,发现:

老的数据有一个字段为空(此字段为此次发布新增),对应的DO该字段为原生数据类型int型,修改为Integer问题解决;

原理:尚未搞清,稍后有时间补上