Mybatis中updateByPrimaryKeySelective和updateByPrimaryKey

在mybatis中常常用到这2中方法。根据实体类主键进行跟新,并返回1或者0. int updateByPrimaryKeySelective(TbItem record); int updateByPrimaryKey(TbItem record);  (1)更新语句上的差异:    因此: updateByPrimaryKeySelective会对字段进行判断再更新(如果为Null就忽略更新)
相关文章
相关标签/搜索