What is MyBatis equivalent to iBatis <isParameterPresent> tag?
Am I migrating an old version of iBatis version 2.? code and I wonder how to replace a tag <isParameterPresent>? I read the MyBatis user guide and know what you can do <if test="">, but I don’t know how to access the parameter object? Does he have a special name? Is there any other tag to use?
+5
1 answer
It turns out there is a special variable called "_parameter". It is not listed in the user manual, but it should be according to Jeff Butler . Then you can check this variable for null.
, <isParameterPresent> <if test="_parameter != null">.
+3