diff --git a/CHANGELOG.md b/CHANGELOG.md index edb31965..a092ba5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ This source code is licensed under Apache 2.0 License. - [x] Duration ## Dependencies upgrade -- [ ] Springboot 3.x support. +- [x] Springboot 3.x support. # NEXT ## Dependencies upgrade @@ -82,6 +82,11 @@ This source code is licensed under Apache 2.0 License. spring-boot-starter-aop ``` + +# 1.1.6 +## Dependencies +- Upgrade to `JDK 17` and SpringBoot `3.x`. + # 1.1.5 ## Bugfix diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a4e9fb8..50fa49f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,9 +2,9 @@ ## Version base You should be having: -- JDK >= 8 +- JDK >= 17 - NebulaGraph > v3.0 -- Springboot 2.x +- Springboot 3.x - Maven ## Clone the repository diff --git a/ngbatis-demo/pom.xml b/ngbatis-demo/pom.xml index 1cbe2a65..f55e8573 100644 --- a/ngbatis-demo/pom.xml +++ b/ngbatis-demo/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.0 + 3.0.7 org.nebula-contrib diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/ColumnAlias.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/ColumnAlias.java index 886d8f6c..dd9a0a2d 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/ColumnAlias.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/ColumnAlias.java @@ -4,10 +4,10 @@ // // This source code is licensed under Apache 2.0 License. -import javax.persistence.Column; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; +import jakarta.persistence.Column; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; /** * 列别名测试用例-实体类 diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Employee.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Employee.java index 25b7f3d9..94181da3 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Employee.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Employee.java @@ -4,9 +4,10 @@ // // This source code is licensed under Apache 2.0 License. -import javax.persistence.Table; import org.nebula.contrib.ngbatis.annotations.Space; +import jakarta.persistence.Table; + /** * @author yeweicheng * @since 2023-01-12 13:20 diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Like.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Like.java index 16d5e52c..2533813c 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Like.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Like.java @@ -4,7 +4,7 @@ // // This source code is licensed under Apache 2.0 License. -import javax.persistence.Table; +import jakarta.persistence.Table; /** *

关系实体类示例。

diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/LikeWithRank.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/LikeWithRank.java index ef44125a..a287f2ca 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/LikeWithRank.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/LikeWithRank.java @@ -4,8 +4,8 @@ // // This source code is licensed under Apache 2.0 License. -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Id; +import jakarta.persistence.Table; /** *

关系实体类示例。

diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/NoPropertiesVertex.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/NoPropertiesVertex.java index 74f9486a..4d661e9b 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/NoPropertiesVertex.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/NoPropertiesVertex.java @@ -4,10 +4,11 @@ // // This source code is licensed under Apache 2.0 License. -import javax.persistence.Id; -import javax.persistence.Table; import org.nebula.contrib.ngbatis.annotations.Space; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + /** * @author yeweicheng * @since 2023-08-02 18:35 diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Person.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Person.java index 1e2dd48e..30f05b2f 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Person.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/Person.java @@ -4,11 +4,12 @@ // // This source code is licensed under Apache 2.0 License. +import ye.weicheng.ngbatis.demo.annotations.ValueType; + +import jakarta.persistence.Id; +import jakarta.persistence.Table; import java.math.BigDecimal; import java.util.Date; -import javax.persistence.Id; -import javax.persistence.Table; -import ye.weicheng.ngbatis.demo.annotations.ValueType; /** *

Person的实体类示例

diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/TimeTest.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/TimeTest.java index ce7159a2..6b33c2c2 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/TimeTest.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/pojo/TimeTest.java @@ -4,13 +4,14 @@ // // This source code is licensed under Apache 2.0 License. +import jakarta.persistence.Column; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + import java.sql.Time; import java.sql.Timestamp; import java.time.Duration; import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Id; -import javax.persistence.Table; /** * @author yeweicheng diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/TestRepository.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/TestRepository.java index 8c3628c6..b641f036 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/TestRepository.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/TestRepository.java @@ -5,10 +5,6 @@ // This source code is licensed under Apache 2.0 License. import com.vesoft.nebula.client.graph.data.ResultSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.persistence.Id; import org.nebula.contrib.ngbatis.models.data.NgEdge; import org.nebula.contrib.ngbatis.models.data.NgSubgraph; import org.nebula.contrib.ngbatis.models.data.NgVertex; @@ -18,6 +14,11 @@ import ye.weicheng.ngbatis.demo.pojo.Person; import ye.weicheng.ngbatis.demo.pojo.PersonLikePerson; +import jakarta.persistence.Id; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * 数据访问层 样例。 *

diff --git a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepository.java b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepository.java index d9c6533e..5062e325 100644 --- a/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepository.java +++ b/ngbatis-demo/src/main/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepository.java @@ -4,10 +4,11 @@ // // This source code is licensed under Apache 2.0 License. -import javax.annotation.Resource; import org.nebula.contrib.ngbatis.proxy.NebulaDaoBasic; import ye.weicheng.ngbatis.demo.pojo.Person; +import jakarta.annotation.Resource; + /** * 数据访问层 样例。 *

diff --git a/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/EmployeeDaoTest.java b/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/EmployeeDaoTest.java index 43b7289e..befc2a50 100644 --- a/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/EmployeeDaoTest.java +++ b/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/EmployeeDaoTest.java @@ -5,11 +5,6 @@ // This source code is licensed under Apache 2.0 License. import com.alibaba.fastjson.JSON; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Random; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -19,6 +14,12 @@ import org.springframework.boot.test.context.SpringBootTest; import ye.weicheng.ngbatis.demo.pojo.Employee; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Random; + /** * Multi tags tests. * @author yeweicheng diff --git a/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepositoryTest.java b/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepositoryTest.java index 119312ac..4e2ec9b7 100644 --- a/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepositoryTest.java +++ b/ngbatis-demo/src/test/java/ye/weicheng/ngbatis/demo/repository/resource/TestRepositoryTest.java @@ -4,15 +4,16 @@ // // This source code is licensed under Apache 2.0 License. -import static org.springframework.util.Assert.isTrue; - -import java.util.Objects; -import javax.annotation.Resource; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import ye.weicheng.ngbatis.demo.repository.TestRepository; +import jakarta.annotation.Resource; +import java.util.Objects; + +import static org.springframework.util.Assert.isTrue; + /** * @author yeweicheng * @since 2023-08-04 17:48 diff --git a/pom.xml b/pom.xml index e51a77b8..55d18369 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.0 + 3.0.7 ngbatis @@ -74,16 +74,30 @@ asm 8.0 + + org.jetbrains + annotations + 13.0 + + org.jsoup jsoup 1.15.3 + + + + com.ibeetl + beetl-spring-jdk17 + 3.15.8.RELEASE + + com.ibeetl - beetl - 3.1.8.RELEASE + beetl-springboot-starter-jdk17 + 3.15.8.RELEASE @@ -168,6 +182,7 @@ 3.2.0 com.facebook.thrift:com.facebook.thrift.* + ${java.home}/bin/javadoc diff --git a/src/main/java/org/nebula/contrib/ngbatis/NgbatisBeanFactoryPostProcessor.java b/src/main/java/org/nebula/contrib/ngbatis/NgbatisBeanFactoryPostProcessor.java index 379973b8..271a9410 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/NgbatisBeanFactoryPostProcessor.java +++ b/src/main/java/org/nebula/contrib/ngbatis/NgbatisBeanFactoryPostProcessor.java @@ -12,7 +12,7 @@ import java.net.UnknownHostException; import java.util.Collection; import java.util.Map; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.nebula.contrib.ngbatis.config.NebulaJdbcProperties; import org.nebula.contrib.ngbatis.config.NgbatisConfig; import org.nebula.contrib.ngbatis.config.ParseCfgProps; diff --git a/src/main/java/org/nebula/contrib/ngbatis/binding/DefaultArgsResolver.java b/src/main/java/org/nebula/contrib/ngbatis/binding/DefaultArgsResolver.java index e8433e4f..7797f720 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/binding/DefaultArgsResolver.java +++ b/src/main/java/org/nebula/contrib/ngbatis/binding/DefaultArgsResolver.java @@ -31,7 +31,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.nebula.contrib.ngbatis.ArgsResolver; import org.nebula.contrib.ngbatis.models.MethodModel; import org.nebula.contrib.ngbatis.utils.ReflectUtil; diff --git a/src/main/java/org/nebula/contrib/ngbatis/config/EnvConfig.java b/src/main/java/org/nebula/contrib/ngbatis/config/EnvConfig.java index afb39e97..ffe934a0 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/config/EnvConfig.java +++ b/src/main/java/org/nebula/contrib/ngbatis/config/EnvConfig.java @@ -4,7 +4,7 @@ // // This source code is licensed under Apache 2.0 License. -import javax.annotation.PreDestroy; +import jakarta.annotation.PreDestroy; import org.nebula.contrib.ngbatis.ArgNameFormatter; import org.nebula.contrib.ngbatis.ArgsResolver; import org.nebula.contrib.ngbatis.Env; diff --git a/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasic.java b/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasic.java index 45eb10eb..159b3b14 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasic.java +++ b/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasic.java @@ -13,13 +13,14 @@ import static org.nebula.contrib.ngbatis.proxy.NebulaDaoBasicExt.proxy; import static org.nebula.contrib.ngbatis.proxy.NebulaDaoBasicExt.vertexName; -import com.sun.istack.NotNull; import com.vesoft.nebula.client.graph.data.ResultSet; import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; + +import org.jetbrains.annotations.NotNull; import org.nebula.contrib.ngbatis.exception.QueryException; import org.nebula.contrib.ngbatis.models.ClassModel; import org.nebula.contrib.ngbatis.models.MethodModel; diff --git a/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasicExt.java b/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasicExt.java index 19d7fde2..78f9273d 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasicExt.java +++ b/src/main/java/org/nebula/contrib/ngbatis/proxy/NebulaDaoBasicExt.java @@ -10,7 +10,7 @@ import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Map; -import javax.persistence.Table; +import jakarta.persistence.Table; import org.nebula.contrib.ngbatis.models.ClassModel; import org.nebula.contrib.ngbatis.models.MapperContext; import org.nebula.contrib.ngbatis.models.MethodModel; diff --git a/src/main/java/org/nebula/contrib/ngbatis/utils/ReflectUtil.java b/src/main/java/org/nebula/contrib/ngbatis/utils/ReflectUtil.java index 47c0db78..3f788c36 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/utils/ReflectUtil.java +++ b/src/main/java/org/nebula/contrib/ngbatis/utils/ReflectUtil.java @@ -16,15 +16,14 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.persistence.Column; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; +import jakarta.persistence.Column; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; import org.nebula.contrib.ngbatis.exception.ParseException; import org.nebula.contrib.ngbatis.models.MethodModel; import org.springframework.util.Assert; -import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl; - +import java.lang.reflect.ParameterizedType; /** *

反射工具类。

* @@ -431,9 +430,9 @@ public static Class typeArg(Object o, Class parent, int i) { if (parent.isInterface()) { Type[] interfaces = insClass.getGenericInterfaces(); for (Type anInterface : interfaces) { - boolean isType = anInterface instanceof ParameterizedTypeImpl; + boolean isType = anInterface instanceof ParameterizedType; if (isType) { - ParameterizedTypeImpl paramTypeInterface = (ParameterizedTypeImpl) anInterface; + ParameterizedType paramTypeInterface = (ParameterizedType) anInterface; boolean found = paramTypeInterface.getRawType() == parent; if (found) { Type[] actualTypeArguments = paramTypeInterface.getActualTypeArguments(); @@ -455,8 +454,8 @@ public static Class typeArg(Object o, Class parent, int i) { * when type is not ParameterizedTypeImpl and the type name can not get class object in jvm. */ public static Class typeToClass(Type type) throws ClassNotFoundException { - if (type instanceof ParameterizedTypeImpl) { - return ((ParameterizedTypeImpl) type).getRawType(); + if (type instanceof ParameterizedType) { + return ((ParameterizedType) type).getRawType().getClass(); } return Class.forName(type.getTypeName()); }