error:for SQL []; SQL state [null]; error code [0]
url:http://deony2jacob1314.iteye.com/blog/1567227
com.tianque.job.realization.AutoSuperviseRedCardTask] failed; nested exception isorg.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorizedSQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in sqlmaps/issueLogNew.xml.
--- The error occurred while applying a result map.
--- Check the issueLogNew.issueLogResult.
--- The error happened while setting a property on the result object.
--- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'timeLimit' to value 'null' for com.tianque.domain.IssueLogNew. Cause: java.lang.IllegalArgumentException; nested exception iscom.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sqlmaps/issueLogNew.xml.
--- The error occurred while applying a result map.
--- Check the issueLogNew.issueLogResult.
--- The error happened while setting a property on the result object.
解决方案: 我的 domain中timeLimit 设定为 private int timeLimit; 查询的结果中timeLimit如果是null,则不能赋值给int类型的timeLime,所以把int类型改为integer即可。
本文介绍了一种在使用MyBatis进行SQL查询时遇到的问题,即当查询结果中某字段为null时,尝试将null赋值给int类型字段引发的异常。通过更改字段类型为Integer,成功解决了这一问题。
3468

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



