Mybatis-Spring
Mybatis-Spring copied to clipboard
deleteByExample,updateByExample的坑
deleteByExample,updateByExample的时候如果Criteria指定的条件为null会忽略该条件,这会导致数据大批量删除或更新,造成很大的安全隐患,相信很多人都不会注意这个问题,建议作者在传入的条件数据为null时不要忽略该条件
你不传默认就是null。。。你传了还是null。。。可以改成空串啊,再说了数据库也不建议用null
| | dc630638147 | | 邮箱:[email protected] |
Signature is customized by Netease Mail Master
在2019年07月09日 09:50,Cloud 写道:
deleteByExample,updateByExample的时候如果Criteria指定的条件为null会忽略该条件,这会导致数据大批量删除或更新,造成很大的安全隐患,相信很多人都不会注意这个问题,建议作者在传入的条件数据为null时不要忽略该条件
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
有两个 safeDelete 和 safeUpdate 参数,可以避免全表操作。