float和Float的问题,错误原因:cannot be translated into a null value
来源:互联网 发布:易语言股票助理源码 编辑:程序博客网 时间:2024/06/11 19:11
今天遇到这个问题
java.lang.IllegalStateException: Optional float parameter 'gas_price' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
是由于sql中使用了where (user_id=#{user_id})
or (card_id=#{card_id})
or (gas_price=#{gas_price}) 这样在只有user_id的情况下,其他只会默认设为null,但是由于我之前将gas_price设为了float,该类型不能赋值为null,所以报错。
解决办法:之前考虑将所有的float设为包装类,然而并没有效果,难道只能通过判断?
0 0
- float和Float的问题,错误原因:cannot be translated into a null value
- Optional int parameter 'folderId' is not present but cannot be translated into a null value due to b
- Optional int parameter 'id' is present but cannot be translated into a null value due to being decla
- Optional int parameter 'page' is present but cannot be translated into a null value due to being dec
- Optional int parameter 'version' is present but cannot be translated into a null value due to being
- Optional int parameter 'id' is present but cannot be translated into a null value due to being decla
- Optional int parameter 'rip' is present but cannot be translated into a null value due to being decl
- Optional int parameter 'topicId' is present but cannot be translated into a null value due to being
- Optional int parameter 'id' is present but cannot be translated into a null value due to being decla
- Optional int parameter 'pageNumber' is present but cannot be translated into a null value due to bei
- 关于Hibernate中的int和float数据及Null value was assigned to a property of primitive type setter of
- 报错: LINQ to Entities does not recognize the method...and this method cannot be translated into a sto
- How to convert an OpenCV cv::Mat into a float* that can be fed into Vlfeat vl_dsift_process ?
- 关于float和double的精度问题
- css float和magin的问题
- float和double的精度问题
- 关于float和double的输入输出问题
- double和float转换的问题
- 正则表达式说明
- MvvmLight框架使用入门(一)
- IDEA配置jdk
- log4j的作用
- 奇葩的Android Bug: Unable to start service Intent
- float和Float的问题,错误原因:cannot be translated into a null value
- iOS "dyld`dyld_fatal_error: -> 0x12000d088 <+0>: brk #0x3"错误
- 安卓应用的版本更新
- [LeetCode]150. Evaluate Reverse Polish Notation
- Socket编程+Google Protocol搭建简单的客户端服务器方式2
- C语言实现双向非循环链表(带头结点尾结点)的节点插入
- 两物体相对位置、追踪速度方向、朝向等计算方向以及角度
- 金牛VS天蝎
- collectionviewcell的圆角和阴影问题