From 0badff0118703007313209821dd7dfcdb7331844 Mon Sep 17 00:00:00 2001 From: xpc1024 <252645816@qq.com> Date: Wed, 29 Jun 2022 18:25:07 +0800 Subject: [PATCH] =?UTF-8?q?v0.9.60=201.=E7=B4=A7=E6=80=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D1=E5=A4=840.9.40=E5=BC=95=E5=85=A5=E7=9A=84=E7=BC=BA?= =?UTF-8?q?=E9=99=B7,=E9=9D=9E=E5=BF=85=E7=8E=B0,=E4=BB=85=E5=9C=A8?= =?UTF-8?q?=E4=B8=8D=E9=85=8D=E7=BD=AE=E7=88=B6=E5=AD=90=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E4=BD=BF=E7=94=A8=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8C=A1=E5=90=AF=E5=8A=A8=E9=A1=B9=E7=9B=AE=E4=BC=9A?= =?UTF-8?q?=E6=8A=A5NPE=EF=BC=88=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B42?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E5=86=85,=E5=8F=91=E7=8E=B0=E5=8D=B3?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=89=202.=E5=8D=87=E7=BA=A7fastjson?= =?UTF-8?q?=E7=94=B11.2.79=E8=87=B31.2.83=E6=9C=80=E6=96=B0=E7=89=88=20?= =?UTF-8?q?=E8=BF=91=E6=9C=9F=E6=AD=A3=E5=9C=A8=E5=81=9A=E5=85=A8=E9=9D=A2?= =?UTF-8?q?=E5=8E=8B=E6=B5=8B=E5=92=8C=E5=8D=95=E6=B5=8B,=E5=8D=B3?= =?UTF-8?q?=E5=B0=86=E4=B8=8A=E7=BA=BF1.0=E7=A8=B3=E5=AE=9A=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easy-es-annotation/pom.xml | 2 +- easy-es-boot-starter/pom.xml | 2 +- .../java/cn/easyes/starter/register/MapperFactoryBean.java | 5 ++++- easy-es-common/pom.xml | 2 +- easy-es-core/pom.xml | 2 +- .../src/main/java/cn/easyes/core/toolkit/IndexUtils.java | 6 ++++-- easy-es-extension/pom.xml | 2 +- easy-es-parent/pom.xml | 4 ++-- easy-es-sample/pom.xml | 2 +- easy-es-test/pom.xml | 2 +- pom.xml | 2 +- 11 files changed, 18 insertions(+), 13 deletions(-) diff --git a/easy-es-annotation/pom.xml b/easy-es-annotation/pom.xml index b26e8dd6..26002410 100644 --- a/easy-es-annotation/pom.xml +++ b/easy-es-annotation/pom.xml @@ -7,7 +7,7 @@ cn.easy-es easy-es-parent - 0.9.50 + 0.9.60 ../easy-es-parent diff --git a/easy-es-boot-starter/pom.xml b/easy-es-boot-starter/pom.xml index 64a003d3..ec268ba9 100644 --- a/easy-es-boot-starter/pom.xml +++ b/easy-es-boot-starter/pom.xml @@ -5,7 +5,7 @@ easy-es-parent cn.easy-es - 0.9.50 + 0.9.60 ../easy-es-parent 4.0.0 diff --git a/easy-es-boot-starter/src/main/java/cn/easyes/starter/register/MapperFactoryBean.java b/easy-es-boot-starter/src/main/java/cn/easyes/starter/register/MapperFactoryBean.java index 29fd2a5f..57673701 100644 --- a/easy-es-boot-starter/src/main/java/cn/easyes/starter/register/MapperFactoryBean.java +++ b/easy-es-boot-starter/src/main/java/cn/easyes/starter/register/MapperFactoryBean.java @@ -24,6 +24,7 @@ import org.springframework.context.ApplicationContext; import java.lang.reflect.Proxy; import java.util.Map; +import java.util.Optional; /** * 代理类 @@ -82,7 +83,9 @@ public class MapperFactoryBean implements FactoryBean { // 将子文档索引激活为父文档索引 if (!DefaultChildClass.class.equals(entityInfo.getChildClass())) { - EntityInfoHelper.getEntityInfo(entityInfo.getChildClass()).setIndexName(entityInfo.getIndexName()); + Optional.ofNullable(entityInfo.getChildClass()) + .flatMap(childClass -> Optional.ofNullable(EntityInfoHelper.getEntityInfo(childClass))) + .ifPresent(childEntityInfo -> childEntityInfo.setIndexName(entityInfo.getIndexName())); } } } else { diff --git a/easy-es-common/pom.xml b/easy-es-common/pom.xml index c6c87767..0f5f9ed9 100644 --- a/easy-es-common/pom.xml +++ b/easy-es-common/pom.xml @@ -6,7 +6,7 @@ cn.easy-es easy-es-parent - 0.9.50 + 0.9.60 ../easy-es-parent diff --git a/easy-es-core/pom.xml b/easy-es-core/pom.xml index ca2c0311..9d224714 100644 --- a/easy-es-core/pom.xml +++ b/easy-es-core/pom.xml @@ -7,7 +7,7 @@ cn.easy-es easy-es-parent - 0.9.50 + 0.9.60 ../easy-es-parent diff --git a/easy-es-core/src/main/java/cn/easyes/core/toolkit/IndexUtils.java b/easy-es-core/src/main/java/cn/easyes/core/toolkit/IndexUtils.java index 00783ebe..a227f1b7 100644 --- a/easy-es-core/src/main/java/cn/easyes/core/toolkit/IndexUtils.java +++ b/easy-es-core/src/main/java/cn/easyes/core/toolkit/IndexUtils.java @@ -491,8 +491,10 @@ public class IndexUtils { boolean addChild = !DefaultChildClass.class.equals(entityInfo.getChildClass()) && !isNested; if (addChild) { // 追加子文档信息 - EntityInfo childEntityInfo = EntityInfoHelper.getEntityInfo(entityInfo.getChildClass()); - List childFieldList = childEntityInfo.getFieldList(); + List childFieldList = Optional.ofNullable(entityInfo.getChildClass()) + .flatMap(childClass->Optional.ofNullable(EntityInfoHelper.getEntityInfo(childClass)) + .map(EntityInfo::getFieldList)) + .orElse(new ArrayList<>(0)); if (!CollectionUtils.isEmpty(childFieldList)) { childFieldList.forEach(child -> { // 子文档仅支持match查询,所以如果用户未指定子文档索引类型,则将默认的keyword类型转换为text类型 diff --git a/easy-es-extension/pom.xml b/easy-es-extension/pom.xml index 134c0802..9d8e3602 100644 --- a/easy-es-extension/pom.xml +++ b/easy-es-extension/pom.xml @@ -7,7 +7,7 @@ cn.easy-es easy-es-parent - 0.9.50 + 0.9.60 ../easy-es-parent diff --git a/easy-es-parent/pom.xml b/easy-es-parent/pom.xml index af2cf044..991b34be 100644 --- a/easy-es-parent/pom.xml +++ b/easy-es-parent/pom.xml @@ -6,7 +6,7 @@ cn.easy-es easy-es-parent - 0.9.50 + 0.9.60 easy-es-parent easy use for elastic search @@ -32,7 +32,7 @@ 1.18.12 7.10.1 7.10.1 - 1.2.79 + 1.2.83 1.6 2.5.4 diff --git a/easy-es-sample/pom.xml b/easy-es-sample/pom.xml index 72f7299c..547dbcaf 100644 --- a/easy-es-sample/pom.xml +++ b/easy-es-sample/pom.xml @@ -9,7 +9,7 @@ easy-es cn.easy-es - 0.9.50 + 0.9.60 diff --git a/easy-es-test/pom.xml b/easy-es-test/pom.xml index e29ec2f0..8cd30046 100644 --- a/easy-es-test/pom.xml +++ b/easy-es-test/pom.xml @@ -7,7 +7,7 @@ easy-es cn.easy-es - 0.9.50 + 0.9.60 easy-es-test diff --git a/pom.xml b/pom.xml index 1556504b..552b7c2c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.easy-es easy-es - 0.9.50 + 0.9.60 easy-es easy use for elastic search