MyBatis提示getFundBonus attempted to return null from a method with a primitive return type (double)
2017-10-13 11:19
453 查看
错误提示:
Caused by: org.apache.ibatis.binding.BindingException: Mapper method 'com.amc.nonstandardinsinfo.dao.mapper.NonstandardInsInfoManageMapper.getFundBonus attempted to return null from a method with a primitive return type (double).
解决方法:
原SQL:
select SUM(t.STOCK_NUMBER) from AMC_BIZ_REC t WHERE t.UUID=123
修改后SQL:
select NVL(SUM(t.STOCK_NUMBER),0) from AMC_BIZ_REC t WHERE t.UUID=123
加上NVL后就可以解决SUM为空时,不能将NULL复制给double类型的问题了。
Caused by: org.apache.ibatis.binding.BindingException: Mapper method 'com.amc.nonstandardinsinfo.dao.mapper.NonstandardInsInfoManageMapper.getFundBonus attempted to return null from a method with a primitive return type (double).
解决方法:
原SQL:
select SUM(t.STOCK_NUMBER) from AMC_BIZ_REC t WHERE t.UUID=123
修改后SQL:
select NVL(SUM(t.STOCK_NUMBER),0) from AMC_BIZ_REC t WHERE t.UUID=123
加上NVL后就可以解决SUM为空时,不能将NULL复制给double类型的问题了。
相关文章推荐
- [置顶] 【java】Mybatis返回int类型为空时报错 attempted to return null from a method with a primitive return type (int)
- mybatis -----attempted to return null from a method with a primitive return type (int)
- 关于attempted to return null from a method with a primitive return type (int).报错解决方案
- delete attempted to return null from a method with a primitive return type (int)
- attempted to return null from a method with a primitive return type (int)异常的解决
- attempted to return null from a method with a primitive return type (int).
- mybatis返回int类型报错 return null from a method with a primitive return type (int).
- MyBatis Error:BindingException Mapper method attempted to return null
- String cannot be resolved to a type - The method getContextPath() from the type HttpServletRequest r
- The method getContextPath() from the type HttpServletRequest refers to the missing type
- 关于Attempt to invoke virtual method 'HSSFCell.getCellType(int)'' on a null object reference
- The method getContextPath() from the type HttpServletRequest refers to the missing type
- The method getContextPath() from the type HttpServletRequest refers to the missing type
- Spring之AOP奇葩报错:Null return value from advice does not match primitive return type for
- the method getcontextpath() from the type httpservletrequest refers to the missing type string
- The method getContextPath() from the type HttpServletRequest refers to the missing type
- The method getContextPath() from the type HttpServletRequest refers to the missing type
- - String cannot be resolved to a type - The method getServerName() from the type ServletRequest
- aop.AopInvocationException: null return value from advice does not match primitive return type for
- The method getContextPath() from the type HttpServletRequest refers to the missing type