Mybatis的if test字符串比较 报NumberFormatException错误
来源:互联网 发布:陌陌直播软件 编辑:程序博客网 时间:2024/06/06 02:42
这里我在mybatis 的xml 文件中没有指定参数类型, prductType 是个String类型的参数 默认为“0”
<if test="productType != '0'">AND a.product_type = #{productType}</if>
执行查询的时候 抛出了这个异常Error querying database. Cause: java.lang.NumberFormatException: For input string: "CI901"
解决办法:
<if test="productType != '0'.toString()"> AND a.product_type = #{productType}</if>总结:省略一些参数时会出现不必要的麻烦,一般最好不要偷懒。
参考:http://blog.csdn.net/chenaini119/article/details/51917263
阅读全文
0 0
- Mybatis的if test字符串比较 报NumberFormatException错误
- Mybatis的Mapper.xml中<if test>报NumberFormatException
- mybatis if test 字符串比较错误处理
- Mybatis的if test字符串比较问题
- Mybatis的if test字符串比较问题
- Mybatis的if test字符串比较问题
- Mybatis的if test字符串比较问题
- Mybatis的if test字符串比较问题
- Mybatis的if test字符串比较问题
- Mybatis if test无效的原因(字符串比较)
- Mybatis 中 if test字符串比较问题
- Mybatis 中 if test字符串比较问题
- Mybatis if test中字符串比较
- Mybatis 中 if test字符串比较问题
- Mybatis if test中字符串比较
- mybatis的NumberFormatException错误
- myBatis test 表达式抛出 NumberFormatException 错误的解决办法
- Mybatis if test中字符串比较(内双外单)
- .classpath文件有什么用?
- matlab 匿名函数
- Android7.0 PowerManagerService(2) WakeLock的使用及流程
- SpringCloud零基础上手(四)——服务发现以及Feign(声明式RESTful服务调用)
- 贪吃蛇游戏总结
- Mybatis的if test字符串比较 报NumberFormatException错误
- c语言解决-分治法在数值问题中的应用—矩阵相乘问题
- 单个字符输入和输出(顺序结构)
- python装饰器
- 【备忘】最新spark/hadoop/hbase/hive/kafka/redies大数据视频教程
- wifi p2p学习
- C/C++面试常见问题总结
- select2应用在modal模态框里,select2搜索框不能输入值
- Java 中的闭包之争