mybatis异常集锦
2024-10-16 09:43:31
【Mybatis】报错:Malformed OGNL expression: name!= null and name != ' '
【Mybatis】报错:Malformed OGNL expression: name!= null and name != ' '
英文感叹号和等号之间不能有空格;
nested exception is org.apache.ibatis.binding.BindingException: Parameter
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'productCode' not found. Available parameters are [prdRuleStageEntity, param1]
int updatePrdRuleStageEntity(Param("prdRuleStageEntity") PrdRuleStageEntity prdRuleStageEntity);
原因是mapper不应该有带 参数的注解。在xml中已经指定了parameter,就不要写@param
invalid comparison: java.util.Date and java.lang.String
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
### Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
原来这是mybatis 3.3.0中对于时间参数进行比较时的一个bug. 如果拿传入的时间类型参数与空字符串''进行对比判断则会引发异常.
<if test="createTime != null and createTime !='' " >
date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})
</if>
改为 <if test="createTime != null">
date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})
</if>
mybatis异常invalid comparison: java.util.Date and java.lang.String
Mybatis报错:There is no getter for property named 'xxxx' in 'class xxxx
一来是检查model中拼写是否错误,二来是检查映射的map是否正确
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
这是一个很容易忽视的点,记住:接口名与Mybatis的映射文件名一定要一模一样。
最新文章
- 从零开始编写自己的C#框架(21)——添加分类类型页面
- 引用、引用和术语定义<;abbr>;<;acronym>;<;address>;<;bdo>;<;blockquote>;<;q>;<;cite>;<;dfn>;
- 20145318 GDB调试汇编堆栈分析
- Jasmine入门(上)
- dll文件是什么
- Windows Store App 插值动画
- 让文字在标签li的底部
- wamp目录索引图片不显示
- (原)Ubuntu16 中安装torch版的cudnn
- 自动获取代理IP信息的例子,含代码,分享哦,
- Android BLE与终端通信(二)——Android Bluetooth基础科普以及搜索蓝牙设备显示列表
- [Swift]LeetCode94. 二叉树的中序遍历 | Binary Tree Inorder Traversal
- Codeforces 1102F Elongated Matrix 状压dp
- postgres访问外网控制
- 用伪类实现一个div的宽度和高度是固定百分比
- Windows下批处理文件(.bat)的使用
- 斯坦福大学Andrew Ng - 机器学习笔记(1) -- 单变量&;多变量线性回归
- 5分钟构建无服务图片鉴黄web应用(基于FunctionGraph)
- 算法(Algorithms)第4版 练习 2.2.26
- 详细解析用Squid实现反向代理的方法
热门文章
- Keil的RTX特性
- vuex2 mapActions 报错 `unknown action type: xxxx`
- [Javascript] ES6 Class Constructors and the Super Keyword
- openjudge1.3
- 洛谷P2068 统计和题解
- charles安装及使用
- ImportError: cannot import name &#39;DjangoSuitConfig&#39;
- SpringBoot之KindEditor文件上传
- docker swarm和compose 的使用(阿里)
- .NETCore websocket