mybatis-mapper / mapper

MyBatis Mapper
https://mapper.mybatis.io
Apache License 2.0
325 stars 47 forks source link

@Entity.Column(updatable = false)不更新,但也不能作为where条件 #39

Closed SuiGaopeng closed 1 year ago

SuiGaopeng commented 2 years ago

最近使用mybatis-mapper集成shardingsphere,shardingsphere要求分片字段不能更新,将对应字段设置为updatable = false,虽然没有更新对应字段,但是在where后面也没有了该字段,造成更新执行了所有分表,建议updatable = false不要直接忽略字段,可以只处理set后的更新字段。

abel533 commented 2 years ago

具体是哪一个方法?现在有根据主键更新的、根据Example更新的,没有发现根据实体字段作为where条件进行更新的方法。

SuiGaopeng commented 2 years ago

根据Example更新。

abel533 commented 2 years ago

根据Example更新中,条件都在Example中,和updateable无关。