From c1d624fc64727cf11bb94cb1a46047b1fc2ecc3c Mon Sep 17 00:00:00 2001 From: zhangyitian Date: Tue, 18 Oct 2022 11:07:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(demo-orm-jdbctemplate/BaseDao):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DgetField=E6=96=B9=E6=B3=95=E6=9C=AA=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E8=A2=AB=E6=B3=A8=E8=A7=A3@Pk=E6=A0=87?= =?UTF-8?q?=E6=B3=A8=E4=B8=BA=E4=B8=BB=E9=94=AE=E7=9A=84Field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/xkcoding/spring-boot-demo/issues/239 --- .../java/com/xkcoding/orm/jdbctemplate/dao/base/BaseDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-orm-jdbctemplate/src/main/java/com/xkcoding/orm/jdbctemplate/dao/base/BaseDao.java b/demo-orm-jdbctemplate/src/main/java/com/xkcoding/orm/jdbctemplate/dao/base/BaseDao.java index 563e7bdaa..267d13b26 100644 --- a/demo-orm-jdbctemplate/src/main/java/com/xkcoding/orm/jdbctemplate/dao/base/BaseDao.java +++ b/demo-orm-jdbctemplate/src/main/java/com/xkcoding/orm/jdbctemplate/dao/base/BaseDao.java @@ -221,7 +221,7 @@ private List getField(T t, Boolean ignoreNull) { // 过滤数据库中不存在的字段,以及自增列 List filterField; - Stream fieldStream = CollUtil.toList(fields).stream().filter(field -> ObjectUtil.isNull(field.getAnnotation(Ignore.class)) || ObjectUtil.isNull(field.getAnnotation(Pk.class))); + Stream fieldStream = CollUtil.toList(fields).stream().filter(field -> ObjectUtil.isNull(field.getAnnotation(Ignore.class)) && ObjectUtil.isNull(field.getAnnotation(Pk.class))); // 是否过滤字段值为null的字段 if (ignoreNull) {