Null Value Replacement in Mybatis

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Null Value Replacement in Mybatis

Kai Tea
Hi,


We're in the process of converting ibatis mapping to mbatis mapping.

However, we noticed ibatis has support for nullValueReplacement

But according to mbatis documentation: http://www.mybatis.org/mybatis-3/sqlmap-xml.html

We don't see equivalent support for null value replacements with mbatis.

Does mbatis still support this or is there another way to acheive the same thing?


Thank you

--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Null Value Replacement in Mybatis

Guy Rouillier-2
 
But this seems like a roundabout solution.  I've always just used the appropriate SQL to address the issue.  For example, with Oracle, you can use NVL(column_name, default_value).  Most DBMSs have something similar.
 
--
Guy Rouillier
 
 
 
------ Original Message ------
From: "Kai Tea" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 7/12/2016 3:36:01 PM
Subject: Null Value Replacement in Mybatis
 
Hi,


We're in the process of converting ibatis mapping to mbatis mapping.

However, we noticed ibatis has support for nullValueReplacement

But according to mbatis documentation: http://www.mybatis.org/mybatis-3/sqlmap-xml.html

We don't see equivalent support for null value replacements with mbatis.

Does mbatis still support this or is there another way to acheive the same thing?


Thank you

--
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].
For more options, visit https://groups.google.com/d/optout.

Virus-free. www.avast.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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Null Value Replacement in Mybatis

Kai Tea
Thanks, going with the SQL route that makes more sense.

On Tuesday, July 12, 2016 at 3:19:05 PM UTC-7, Guy Rouillier wrote:
I found a discussion on Stack OverFlow: <a href="http://stackoverflow.com/questions/22852383/how-to-change-valuenull-to-empty-string-from-query-when-using-mybatis" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F22852383%2Fhow-to-change-valuenull-to-empty-string-from-query-when-using-mybatis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNENzL2BtiLa-O2i9W_Hj__2n3MaAA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F22852383%2Fhow-to-change-valuenull-to-empty-string-from-query-when-using-mybatis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNENzL2BtiLa-O2i9W_Hj__2n3MaAA&#39;;return true;">http://stackoverflow.com/questions/22852383/how-to-change-valuenull-to-empty-string-from-query-when-using-mybatis
 
But this seems like a roundabout solution.  I've always just used the appropriate SQL to address the issue.  For example, with Oracle, you can use NVL(column_name, default_value).  Most DBMSs have something similar.
 
--
Guy Rouillier
 
 
 
------ Original Message ------
From: "Kai Tea" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="QYhQV9dKAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kaite...@...>
To: "mybatis-user" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="QYhQV9dKAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 7/12/2016 3:36:01 PM
Subject: Null Value Replacement in Mybatis
 
Hi,


We're in the process of converting ibatis mapping to mbatis mapping.

However, we noticed ibatis has support for nullValueReplacement

But according to mbatis documentation: <a href="http://www.mybatis.org/mybatis-3/sqlmap-xml.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.mybatis.org%2Fmybatis-3%2Fsqlmap-xml.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGv6NkIzTlaLqSrnPK2gs5RlnGJfg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.mybatis.org%2Fmybatis-3%2Fsqlmap-xml.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGv6NkIzTlaLqSrnPK2gs5RlnGJfg&#39;;return true;">http://www.mybatis.org/mybatis-3/sqlmap-xml.html

We don't see equivalent support for null value replacements with mbatis.

Does mbatis still support this or is there another way to acheive the same thing?


Thank you

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="QYhQV9dKAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

<a href="https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=emailclient&amp;utm_term=oa-2368-c" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fsig-email%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient%26utm_term%3Doa-2368-c\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRuWhYUtACuPSesiO4DQ13lBVO1g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fsig-email%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient%26utm_term%3Doa-2368-c\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRuWhYUtACuPSesiO4DQ13lBVO1g&#39;;return true;"> Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=emailclient&amp;utm_term=oa-2368-c" style="color:#4453ea" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fsig-email%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient%26utm_term%3Doa-2368-c\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRuWhYUtACuPSesiO4DQ13lBVO1g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avast.com%2Fsig-email%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient%26utm_term%3Doa-2368-c\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRuWhYUtACuPSesiO4DQ13lBVO1g&#39;;return true;">www.avast.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].
For more options, visit https://groups.google.com/d/optout.
Loading...