Skip to content

Commit cf60caf

Browse files
authored
Merge pull request #374 from CorvusYe/for-jdk17
For jdk17
2 parents 052d714 + 25abfca commit cf60caf

File tree

89 files changed

+4762
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4762
-444
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
java-version: 1.8
3131

3232
- name: Cache the Maven packages to speed up build
33-
uses: actions/cache@v2
33+
uses: actions/cache@v4
3434
with:
3535
path: ~/.m2/repository
3636
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

.github/workflows/snapshot.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
with:
1919
java-version: 17
2020

21-
- name: Install nebula-graph
22-
run: |
23-
mkdir tmp
24-
pushd tmp
25-
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
26-
pushd nebula-docker-compose/
27-
cp ../../src/test/resources/docker-compose.yaml .
28-
docker compose up -d
29-
sleep 30
30-
docker compose ps
31-
popd
32-
popd
21+
# - name: Install nebula-graph
22+
# run: |
23+
# mkdir tmp
24+
# pushd tmp
25+
# git clone https://github.com/vesoft-inc/nebula-docker-compose.git
26+
# pushd nebula-docker-compose/
27+
# cp ../../src/test/resources/docker-compose.yaml .
28+
# docker compose up -d
29+
# sleep 30
30+
# docker compose ps
31+
# popd
32+
# popd
3333

3434
- name: Deploy Snapshot to Maven package
3535
uses: samuelmeuli/action-maven-publish@v1

CHANGELOG-CN.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
2+
<!--
3+
Copyright (c) 2024 All project authors and nebula-contrib. All rights reserved.
4+
5+
This source code is licensed under Apache 2.0 License.
6+
-->
7+
8+
# 2.1.0-beta
9+
10+
## 新特性
11+
12+
- 支持复合对象属性类型为 NgEdge、NgVertex(含集合),不再需要另外定义 ResultHandler
13+
- NebulaDaoBasic 拓展 updateEdgeByIdBatchSelective 接口,支持批量更新边(需自行控制单批数量)
14+
- 拓展模板方法:ng.srcId、ng.dstId,分别读取 `@SrcId` `@DstId` 的属性值
15+
16+
> 如果项目中覆盖原来 beetl.properties,需追加新函数配置:
17+
> ```diff
18+
> + FN.ng.srcId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetSrcIdFn
19+
> + FN.ng.dstId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetDstIdFn
20+
> ```
21+
22+
## Bug修复
23+
24+
- 修复执行报错时产生连接未回收的泄漏问题
25+
- 修复 ng.include 在多行的情况下,模板无法正常使用的问题
26+
27+
# 2.0.1
28+
29+
## Bug修复
30+
31+
- fix [#63](https://github.com/nebula-contrib/ngbatis/pull/63): 在 ASM 生成代理类时,自动计算方法的最大栈深及局部变量表个数。 来自: [@moroyimk](https://github.com/moroyimk)
32+
- fix: 修复自定义 xml 中, `Duration` 作为属性类型不被支持的问题
33+
- revert: 回退关于 2.0.0-beta.1 的修改。
34+
> 为兼容 `${ ng.valueFmt( value ) }`, 当 value 为 null 时,依然可以输出占位符,可使用以下方式
35+
>
36+
> ```beetl
37+
> ${ ng.valueFmt( value ) ! "null" }
38+
> ```
39+
>
40+
- fix: 修复字段属性为 Byte 时,不能正常解析到实体对象的问题。
41+
42+
## 新特性
43+
44+
- 支持Geo类型
45+
46+
字段类型 | 属性类型
47+
---|---
48+
geo(point) | org.springframework.data.geo.Box
49+
geo(linestring) | org.springframework.data.geo.Point
50+
geo(polygon) | org.springframework.data.geo.Polygon
51+
geo | Object
52+
53+
- 支持节点的属性对象字段可以与实体对象直接映射
54+
55+
```java
56+
@Table(name = "column_alias")
57+
public class ColumnAlias {
58+
@Id @Column(name = "id_no") private String idNo;
59+
@Column(name = "first_name") private String firstName;
60+
@Column(name = "last_name") private String lastName;
61+
@Transient private String ignoreMe;
62+
}
63+
```
64+
65+
```xml
66+
<select id="propsToObj">
67+
MATCH (n :column_alias)
68+
WHERE n.column_alias.first_name is not null
69+
RETURN
70+
properties(n),
71+
"ignoreMe" as ignoreMe
72+
LIMIT 1
73+
</select>
74+
```
75+
76+
## Upgrade
77+
78+
- upgrade: 升级 fastjson 版本至 2.0.57.
79+
80+
# 2.0.0-beta.1
81+
82+
## Bugfix
83+
84+
- fix: 修复 `ng.valueFmt( value )` 中 value 为 null 时,无法输出 null 进行占位的问题。
85+
86+
# 2.0.0-beta
87+
88+
## Bug修复
89+
90+
- fix: [#329](https://github.com/nebula-contrib/ngbatis/issues/329) 修正返回值类型并明确接口泛型。[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
91+
- fix: 移除 JDK8 的内部 API: ParameterizedTypeImpl
92+
93+
## 新特性
94+
95+
- feat: 实体直接搜索。 ([#319](https://github.com/nebula-contrib/ngbatis/pull/319), 来自:[@xYLiuuuuuu](https://github.com/n3A87))
96+
- 实体可以继承 `GraphBaseVertex``GraphBaseEdge` 来支持直接搜索。
97+
- GraphBaseVertex:
98+
99+
API | 用法说明
100+
--|--
101+
queryIdsByProperties() | 查询特定Tag或者属性的点Id集合
102+
queryVertexById() | 查询特定点Id的单个点
103+
queryVertexByTag() | 查询特定Tag的点集合
104+
queryVertexByProperties() | 查询特定属性的点集合
105+
queryAllAdjacentVertex(Class<?>... edgeClass) | 查询特定点的所有邻点集合,可指定一个或多个连接两点的边类型
106+
queryIncomingAdjacentVertex(Class<?>... edgeClass) | 查询特定点入边方向的邻点集合,可指定一个或多个连接两点的边类型
107+
queryOutgoingAdjacentVertex(Class<?>... edgeClass) | 查询特定点出边方向的邻点集合,可指定一个或多个连接两点的边类型
108+
queryNeighborIdsWithHopById(int m, int n, Class<?>... edgeClass) | 查询特定点指定跳数内的点Id集合,可指定一个或多个连接两点的边类型
109+
queryConnectedEdgesById(Direction direction) | 查询特定点关联的所有边集合,可指定边的方向和类型
110+
queryPathFromVertex(Direction direction) | 查询特定点关联的所有路径集合,可指定边的方向
111+
queryFixedLengthPathFromVertex(Integer maxHop, Direction direction, Class<?>... edgeClass) | 查询特定点出发的定长路径集合,可指定最大步数、边的方向、边的类型
112+
queryVariableLengthPathFromVertex(Integer minHop, Integer maxHop, Direction direction, Class<?>... edgeClass) | 查询特定点出发的变长路径集合,可指定最小步数、最大步数、边的方向、边的类型
113+
queryShortestPathFromSrcAndDst(Integer maxHop, Direction direction, T v2) | 查询特定点出发的任意一条最短路径,可指定步数、边的方向、终点实体
114+
queryAllShortestPathsFromSrcAndDst(Integer maxHop, Direction direction, T v2) | 查询从该点出发的所有最短路径集合,可指定步数、边的方向、终点实体
115+
queryVertexCountByTag() | 查询特定Tag的点的数量
116+
117+
- GraphBaseEdge:
118+
119+
API | 用法说明
120+
--|--
121+
queryEdgeByType(Direction direction) | 查询特定类型、方向的边集合
122+
queryEdgeWithSrcAndDstByProperties(T srcVertex, Direction direction, T dstVertex) | 查询特定属性的边集合
123+
queryEdgePropertiesBySrcAndDstId() | 查询特定始终点id的边集合
124+
queryEdgeCountByType() | 查询特定Type的边的数量
125+
126+
- feat: 修复 [#324](https://github.com/nebulagraph/ngbatis/issues/324) 在 NebulaDaoBasic 中增加 insertForce(v) insertSelectiveForce(v)。[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
127+
- feat: @Space 注解和 Mapper xml 中的 space 配置支持动态配置。 ([#318](https://github.com/nebula-contrib/ngbatis/pull/318), 来自:[@charle004](https://github.com/charle004))
128+
- feat: 支持 yml 中配置多个 mapper-locations。 ([#318](https://github.com/nebulagraph/ngbatis/pull/318), 来自:[@charle004](https://github.com/charle004))
129+
- feat: SessionPool 支持使用 `spaceFromParam`进行运行时的图空间切换,包括运行后才创建的图空间。

CHANGELOG.md

Lines changed: 137 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,139 @@ This source code is licensed under Apache 2.0 License.
1818
- [ ] show metas
1919
- [ ] create | alter tag & edge type
2020
- [ ] index
21-
- [ ] ResultSetUtil more column types support
22-
- [ ] Geography
21+
- [x] ResultSetUtil more column types support
22+
- [x] Geography
2323
- [x] Duration
2424

2525
## Dependencies upgrade
2626

2727
- [x] Springboot 3.x support. (lastest-jdk17)
2828

29-
# NEXT
29+
# 2.1.0-beta
30+
31+
## Features
32+
33+
- Support for composite object property types as NgEdge, NgVertex (including collections), no longer need to define ResultHandler separately
34+
35+
- NebulaDaoBasic extends updateEdgeByIdBatchSelective interface, supporting batch updates of edges (you need to control the quantity of each batch)
36+
37+
- Extended template methods: ng.srcId, ng.dstId, which read the property values of @SrcId and @DstId respectively
38+
39+
> If you override the original beetl.properties in your project, you need to add the new function configuration:
40+
> ```diff
41+
> + FN.ng.srcId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetSrcIdFn
42+
> + FN.ng.dstId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetDstIdFn
43+
> ```
44+
45+
## Bugfix
46+
47+
- Fixed connection leak issue when an error occurs during execution.
48+
- Fix the issue where the template fails to function properly when using `ng.include` across multiple lines.
49+
50+
# 2.0.1
51+
52+
## Bugfix
53+
54+
- fix ([#63](https://github.com/nebula-contrib/ngbatis/pull/63): automatically calculating stack and local variables in asm. via: [@moroyimk](https://github.com/moroyimk)
55+
- fix: fix the issue of `Duration` type in custom xml
56+
- revert: revert the change of 2.0.0-beta.1
57+
> To be compatible with `${ ng.valueFmt( value ) }`, when value is null, it can still output a placeholder. You can use the following method:
58+
>
59+
> ```beetl
60+
> ${ ng.valueFmt( value ) ! "null" }
61+
> ```
62+
>
63+
- fix: fix the issue of field type is Byte, cannot be parsed to entity object.
64+
65+
## Feature
66+
67+
- Supporting geometry types.
68+
69+
db type | java type
70+
---|---
71+
geo(point) | org.springframework.data.geo.Box
72+
geo(linestring) | org.springframework.data.geo.Point
73+
geo(polygon) | org.springframework.data.geo.Polygon
74+
geo | Object
75+
76+
- Supporting props can be directly mapped to entity objects.
77+
78+
```java
79+
@Table(name = "column_alias")
80+
public class ColumnAlias {
81+
@Id @Column(name = "id_no") private String idNo;
82+
@Column(name = "first_name") private String firstName;
83+
@Column(name = "last_name") private String lastName;
84+
@Transient private String ignoreMe;
85+
}
86+
```
87+
88+
```xml
89+
<select id="propsToObj">
90+
MATCH (n :column_alias)
91+
WHERE n.column_alias.first_name is not null
92+
RETURN
93+
properties(n),
94+
"ignoreMe" as ignoreMe
95+
LIMIT 1
96+
</select>
97+
```
98+
99+
## Upgrade
100+
101+
- upgrade: upgrade fastjson version to 2.0.57.
102+
103+
# 2.0.0-beta.1
104+
105+
## Bugfix
106+
107+
- fix: `ng.valueFmt( value )` cannot output null as a placeholder when value is null.
108+
109+
# 2.0.0-beta
110+
111+
## Bugfix
112+
113+
- fix: [#329](https://github.com/nebula-contrib/ngbatis/issues/329) correct the return value type and clear the interface generic.[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
114+
- fix: remove JDK8's internal API: ParameterizedTypeImpl
115+
116+
## Feature
117+
118+
- feat: Entity Direct Search. ([#319](https://github.com/nebula-contrib/ngbatis/pull/319), via: [@xYLiuuuuuu](https://github.com/n3A87))
119+
- Entities can extend `GraphBaseVertex` or `GraphBaseEdge` to support direct search.
120+
- GraphBaseVertex:
121+
122+
API | Usage instructions
123+
--|--
124+
queryIdsByProperties() | Query a collection of vertex ids for a particular Tag or attribute
125+
queryVertexById() | Query a single vertex for a specific vertex Id
126+
queryVertexByTag() | Query a collection of vertices for a specific Tag
127+
queryVertexByProperties() | Query a collection of vertexes for a specific property
128+
queryAllAdjacentVertex(Class<?>... edgeClass) | Query a collection of all neighboring vertexes of a particular vertex, specifying one or more edge types that connect the two vertexes
129+
queryIncomingAdjacentVertex(Class<?>... edgeClass) | Query the set of adjacent vertexes in the direction of the incoming edge of a particular vertex, specifying one or more edge types that connect two vertexes
130+
queryOutgoingAdjacentVertex(Class<?>... edgeClass) | Query the set of adjacent vertexes in the direction of the edge of a particular vertex, specifying one or more edge types that connect two vertexes
131+
queryNeighborIdsWithHopById(int m, int n, Class<?>... edgeClass) | Query a collection of vertex ids within a specified number of hops for a particular vertex, specifying one or more edge types that connect two vertexes
132+
queryConnectedEdgesById(Direction direction) | Query the set of all edges associated with a particular vertex, specifying the direction and type of the edge
133+
queryPathFromVertex(Direction direction) | Query the collection of all paths associated with a particular vertex, specifying the direction of the edge
134+
queryFixedLengthPathFromVertex(Integer maxHop, Direction direction, Class<?>... edgeClass) | Query a set of fixed-length paths from a specific vertex, specifying the maximum number of steps, the direction of the edge, and the type of the edge
135+
queryVariableLengthPathFromVertex(Integer minHop, Integer maxHop, Direction direction, Class<?>... edgeClass) | Query a set of variable-length paths from a specific vertex, specifying the minimum number of steps, the maximum number of steps, the direction of the edge, and the type of the edge
136+
queryShortestPathFromSrcAndDst(Integer maxHop, Direction direction, T v2) | Query any shortest path from a specific vertex, specifying the number of steps, the direction of the edge, and the end vertex entity
137+
queryAllShortestPathsFromSrcAndDst(Integer maxHop, Direction direction, T v2) | Query the set of all shortest paths from this vertex, specifying the number of steps, the direction of the edge, and the end vertex entity
138+
queryVertexCountByTag() | Query the number of vertexes for a specific Tag
139+
140+
- GraphBaseEdge:
141+
142+
API | Usage instructions
143+
--|--
144+
queryEdgeByType(Direction direction) | Query a set of edges of a specific type and direction
145+
queryEdgeWithSrcAndDstByProperties(T srcVertex, Direction direction, T dstVertex) | Query a set of edges for a particular property
146+
queryEdgePropertiesBySrcAndDstId() | Query a set of edges for a specific always vertex id
147+
queryEdgeCountByType() | Query the number of edges for a specific Type
148+
149+
- feat: fix [#324](https://github.com/nebulagraph/ngbatis/issues/324) add insertForce(v) insertSelectiveForce(v) into NebulaDaoBasic.[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
150+
- feat: `@Space` annotation and space config in mapper xml supports dynamic configuration. ([#318](https://github.com/nebula-contrib/ngbatis/pull/318), via: [@charle004](https://github.com/charle004))
151+
> `@Space` 注解的 name 属性值和 xml 文件中 Mapper 标签指定的 Space 可通过 spring 配置文件自定义配置。
152+
- feat: support multiple mapper-locations in yml. ([#318](https://github.com/nebula-contrib/ngbatis/pull/318), via: [@charle004](https://github.com/charle004))
153+
- feat: SessionPool support `spaceFromParam`.
30154

31155
# 1.3.0
32156

@@ -87,9 +211,9 @@ This source code is licensed under Apache 2.0 License.
87211
person:
88212
space: PERSON_SPACE
89213
```
90-
214+
91215
```java
92-
@Space(name = "${nebula.space}")
216+
@Space(name = "${app.person.space}")
93217
@Table(name = "person")
94218
public class Person {
95219
@Id
@@ -114,6 +238,14 @@ This source code is licensed under Apache 2.0 License.
114238
}
115239
```
116240

241+
- XML example:
242+
243+
```xml
244+
<mapper namespace="com.xxx.TestSpaceMapper" space="${app.person.space}">
245+
246+
</mapper>
247+
```
248+
117249
# 1.2.2
118250

119251
## Bugfix

0 commit comments

Comments
 (0)