Error evaluating expression ‘ew.sqlSegment != null and ew.sqlSegment != ‘‘ and ew.nonEmptyOfWhere‘

关于 mybatis-plus  3.4.3版本 报错问题:

问题版本如下

报错问题

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere'. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [java.lang.ExceptionInInitializerError]

    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
 

解决方法

避免使用 mybatis-plus  3.4.3版本

如图:

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'employee.startDate != null and employee.endDate ! = null'. Cause: org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression: employee.startDate != null and employee.endDate ! = null [org.apache.ibatis.ognl.ParseException: Encountered " "!" "! "" at line 1, column 53. 这个异常是由于动态 SQL 的拼接出现问题导致的。根据异常信息,可以看出在表达式 'employee.startDate != null and employee.endDate ! = null' 中有语法错误。具体来说,在这个表达式中,有一个空格和一个感叹号被错误地放置在了中间,导致语法错误。为了解决这个问题,你可以检查你的动态 SQL 语句,并确保表达式的语法正确。 另外,你还可以参考中提到的 Mybatis 报错解决办法的相关资料,可能会对你解决这个问题有所帮助。同时,你也可以根据中提供的解决办法,将动态 SQL 中的 item 属性更改为不同的值,以避免出现类似问题。 总结起来,你需要检查你的动态 SQL 语句中的表达式,确保语法正确,并且可以参考相关资料和解决办法来解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 的解决...](https://blog.csdn.net/Hello_World_QWP/article/details/86514214)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法](https://download.csdn.net/download/weixin_38524871/12828533)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 异常](https://blog.csdn.net/ren9436/article/details/120454494)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值