mybatis / mybatis-3

MyBatis SQL mapper framework for Java
http://mybatis.github.io/mybatis-3/
Apache License 2.0
19.72k stars 12.82k forks source link

ExpressionEvaluator supports the logic for checking empty collections… #3122

Closed quicklyfast closed 6 months ago

quicklyfast commented 6 months ago

ExpressionEvaluator supports the logic for checking empty collections and empty strings

harawata commented 6 months ago

Thank you for the PR, @quicklyfast .

OGNL does not treat empty string/collection/array as boolean, so this will confuse users especially when the expression contains multiple conditions combined with and or or.

You can easily check the size of string, array or collection.