在ibatis2.X中曾经是:
<isEmpty property="userName" >
现在在MyBatis中它就像:
<if test="userName != null && userName.trim().length !=0 " >
我想在MyBatis中找到isEmpty
的简单替代方法。我发现我也可以使用这个结构:
<if test="@org.apache.commons.StringUtils@isEmpty(userName)" >
但它也不是很方便。
也许我错过了一些东西,MyBatis中有<isEmpty>
,甚至像<if test="isEmpty(userName)" >
这样的东西也足够好了。你能建议吗?