【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的映射文件名一定要一模一样。

最新文章

  1. 从零开始编写自己的C#框架(21)——添加分类类型页面
  2. 引用、引用和术语定义&lt;abbr&gt;&lt;acronym&gt;&lt;address&gt;&lt;bdo&gt;&lt;blockquote&gt;&lt;q&gt;&lt;cite&gt;&lt;dfn&gt;
  3. 20145318 GDB调试汇编堆栈分析
  4. Jasmine入门(上)
  5. dll文件是什么
  6. Windows Store App 插值动画
  7. 让文字在标签li的底部
  8. wamp目录索引图片不显示
  9. (原)Ubuntu16 中安装torch版的cudnn
  10. 自动获取代理IP信息的例子,含代码,分享哦,
  11. Android BLE与终端通信(二)——Android Bluetooth基础科普以及搜索蓝牙设备显示列表
  12. [Swift]LeetCode94. 二叉树的中序遍历 | Binary Tree Inorder Traversal
  13. Codeforces 1102F Elongated Matrix 状压dp
  14. postgres访问外网控制
  15. 用伪类实现一个div的宽度和高度是固定百分比
  16. Windows下批处理文件(.bat)的使用
  17. 斯坦福大学Andrew Ng - 机器学习笔记(1) -- 单变量&amp;多变量线性回归
  18. 5分钟构建无服务图片鉴黄web应用(基于FunctionGraph)
  19. 算法(Algorithms)第4版 练习 2.2.26
  20. 详细解析用Squid实现反向代理的方法

热门文章

  1. Keil的RTX特性
  2. vuex2 mapActions 报错 `unknown action type: xxxx`
  3. [Javascript] ES6 Class Constructors and the Super Keyword
  4. openjudge1.3
  5. 洛谷P2068 统计和题解
  6. charles安装及使用
  7. ImportError: cannot import name &#39;DjangoSuitConfig&#39;
  8. SpringBoot之KindEditor文件上传
  9. docker swarm和compose 的使用(阿里)
  10. .NETCore websocket