Migration of $dynamicSQL$ to mybatis

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Migration of $dynamicSQL$ to mybatis

Ivan Yonchovski
Hi all,

I am migrating code from ibatis to mybatis, what is the equivalent of:

<isNotEmpty prepend="and" property="dynamicSql">
   $dynamicSql$
</isNotEmpty>

Thanks,
Ivan

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/137102b3-f1a6-4927-acf3-3f6dbfe5efc8%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Migration of $dynamicSQL$ to mybatis

Iwao AVE!
Hi Ivan,

Sorry about the late reply.
Assuming dynamicSql is java.lang.String, this should work:

<if test="dynamicSql != null and !dynamicSql.isEmpty()">
  ${dynamicSql}
</if>

Regards,
Iwao

On Thu, May 28, 2020 at 8:09 PM Ivan Yonchovski <[hidden email]> wrote:
Hi all,

I am migrating code from ibatis to mybatis, what is the equivalent of:

<isNotEmpty prepend="and" property="dynamicSql">
   $dynamicSql$
</isNotEmpty>

Thanks,
Ivan

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/137102b3-f1a6-4927-acf3-3f6dbfe5efc8%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2TZ6R1Y6nbEgnmVKgqFb5XFA-DCE%3D-Zpq1Mx_ZPDL%2BBJw%40mail.gmail.com.