`

ibatis update set null

 
阅读更多
Today , when I want to set a field null using Ibatis .
I found we must modify the generated mapping file .

In the default mapping file :
<if test="thefield != null">the_field = #{thefield},</if> .

If wanna set the the_field to null , in your program , you must add
a script :

<if test="thefield == null">the_field = #{the_field},</if> .


So if you wanna update  a field to null ,  the field was not null .
Be careful !

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics