atq

导航

 

利用updateByPrimaryKeySelective方法,是无法实现清空操作,因为在XML文件中有NULL判断。

方法1 :

 bean.setValue(null);

Mapper.updateByPrimaryKeyWithBLOBs(bean);

可以使用 updateByPrimaryKeyWithBLOBs方法来实现,弊端就是会更新记录的全部字段!!

方法2:

自己写XML,设置成NULL.

posted on 2020-05-14 10:57  atq  阅读(1912)  评论(0)    收藏  举报