From 65fad9b03898104315368939a04424a9cb4d26d2 Mon Sep 17 00:00:00 2001 From: zhangting Date: Thu, 11 Jan 2018 15:17:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E4=BA=8Emybatis=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=BC=93=E5=AD=98=E7=9A=84=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=98=AF=E5=BB=BA=E7=AB=8B=E5=9C=A8namespace=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=9C=A8insert=E3=80=81delete?= =?UTF-8?q?=E3=80=81update=E6=97=B6=E9=83=BD=E4=BC=9A=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 但在这两个接口上标注了@Options,但flushCache默认为false,这对于使用了二级缓存的人来说无非造成了很大的困扰,更新数据后缓存并未刷新,查询时却拿到了之前的脏数据,希望能将此接口做出调整,避免带来不必要的麻烦 Signed-off-by: zhangting <276356445> --- .../mapper/common/base/update/UpdateByPrimaryKeyMapper.java | 2 +- .../common/base/update/UpdateByPrimaryKeySelectiveMapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeyMapper.java b/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeyMapper.java index 199664c..b60ed78 100644 --- a/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeyMapper.java +++ b/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeyMapper.java @@ -43,7 +43,7 @@ public interface UpdateByPrimaryKeyMapper { * @return */ @UpdateProvider(type = BaseUpdateProvider.class, method = "dynamicSQL") - @Options(useCache = false, useGeneratedKeys = false) + @Options(useCache = false, useGeneratedKeys = false, flushCache = true) int updateByPrimaryKey(T record); } \ No newline at end of file diff --git a/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeySelectiveMapper.java b/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeySelectiveMapper.java index e460974..93fa001 100644 --- a/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeySelectiveMapper.java +++ b/src/main/java/tk/mybatis/mapper/common/base/update/UpdateByPrimaryKeySelectiveMapper.java @@ -43,7 +43,7 @@ public interface UpdateByPrimaryKeySelectiveMapper { * @return */ @UpdateProvider(type = BaseUpdateProvider.class, method = "dynamicSQL") - @Options(useCache = false, useGeneratedKeys = false) + @Options(useCache = false, useGeneratedKeys = false, flushCache = true) int updateByPrimaryKeySelective(T record); } \ No newline at end of file -- Gitee