Take the 2-minute tour ×

I am porting some old iBatis version 2.? code and am wondering how to replace the <isParameterPresent> tag? I have read the MyBatis user guide, and know you can do a <if test=""> but I do not know how to refer to the the parameter object? Does it have a special name? Is there a different tag to use?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

It turns out that there is a special variable called "_parameter". It does not appear in the user guide, but it should be there according to Jeff Butler. You can then test this variable for null.

Thus it seems the replacement for <isParameterPresent> is <if test="_parameter != null">.

share|improve this answer

Your Answer


