【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)问题