if test no String parameter - Dynamic SQL

122 views
Skip to first unread message

Roberto Sanz Perez

unread,
Jun 10, 2022, 4:33:17 AM6/10/22
to mybatis-user
Hi, when we test somethis like this:
<if test="param != null and param != ''">
only works if param type is String, otherwise it fails in some cases

For excample:
if param is number and the value is 0.0 then test returns FALSE but param have a value.

if param is boolean and the value is false then test returns FALSE but param have a value.


There is a bug? Can we solve it is someway or we hace to chage all de if test? (we have more than 1500 ocurrences)

Thanks
Reply all
Reply to author
Forward
0 new messages