Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
d6554a7
- optimized code format
knqiufan Jun 12, 2024
4336640
- optimized showSpaces method code
knqiufan Jun 12, 2024
fb6eafb
support multiple mapper-locations
charle004 Sep 5, 2024
6ab3248
space config in mapper xml supports dynamic configuration
charle004 Sep 9, 2024
4e4a1f8
changelog style
charle004 Sep 9, 2024
ff9c93a
changelog style
charle004 Sep 9, 2024
5f17590
changelog style
charle004 Sep 9, 2024
e6ff626
feat:support query directly by entity
n3A87 Sep 17, 2024
d966131
checkstyle
n3A87 Sep 17, 2024
eca8966
checkstyle2
n3A87 Sep 17, 2024
9e50c39
checkstyle + @Column
n3A87 Sep 17, 2024
21f1043
Merge branch 'master' into master
knqiufan Sep 21, 2024
6047888
- Fix bugs
knqiufan Sep 21, 2024
93f8b22
Merge remote-tracking branch 'origin/master'
knqiufan Sep 21, 2024
bb2829a
fix nGQL injection issue
n3A87 Oct 1, 2024
1d4e1cb
checkstyle
n3A87 Oct 1, 2024
22ebd69
Merge pull request #320 from knqiufan/master
knqiufan Oct 28, 2024
0e417f0
Merge pull request #319 from n3A87/ORM2OGM
knqiufan Oct 29, 2024
b6131a4
补充实体直查功能文档
n3A87 Nov 3, 2024
c81d957
调整md格式
n3A87 Nov 3, 2024
cb96cda
correct details
n3A87 Nov 14, 2024
d7ab9b5
Merge pull request #322 from n3A87/ORM2OGM
CorvusYe Nov 16, 2024
4a52c63
adjust code styles
n3A87 Dec 12, 2024
ccfb8d0
Merge pull request #326 from n3A87/adjust-code-style
CorvusYe Dec 13, 2024
cc64f7b
feat: session pool supports creating through `spaceFromParam`
CorvusYe Dec 17, 2024
5074616
Merge pull request #330 from CorvusYe/master
CorvusYe Dec 17, 2024
05f2ffb
feat: supporting SessionPool calls for direct data query.
CorvusYe Dec 17, 2024
e7330eb
Merge pull request #331 from CorvusYe/master
CorvusYe Dec 17, 2024
6635581
feat: entity direct query supports specifying different spaces.
CorvusYe Dec 18, 2024
1aef6f2
feat: allow get space by entityType
CorvusYe Dec 18, 2024
bb39d71
Merge pull request #332 from CorvusYe/master
CorvusYe Dec 18, 2024
e88b651
fix: remove JDK8's internal API: ParameterizedTypeImpl
CorvusYe Dec 18, 2024
47f86a4
Merge pull request #333 from CorvusYe/master
CorvusYe Dec 18, 2024
3761c3b
refact: Unified primary key annotation.
CorvusYe Dec 18, 2024
ac8854e
refact: unified primary key annotation.
CorvusYe Dec 18, 2024
4bc2d09
Merge pull request #334 from CorvusYe/master
CorvusYe Dec 18, 2024
8cc98a7
fix#329: correct the return value type and clear the interface generic.
CorvusYe Dec 18, 2024
087e9ad
feat#324: [NebulaDaoBasic] add methods: insertForce(v) insertSelectiv…
CorvusYe Dec 18, 2024
8dd9f1f
Merge pull request #335 from CorvusYe/master
CorvusYe Dec 18, 2024
d783eb4
Merge branch 'pr/318'
CorvusYe Dec 19, 2024
5f139f1
(v2.0.0-beta)feat: Support switching graph space based on parameters …
CorvusYe Dec 21, 2024
854cfe6
Merge pull request #336 from CorvusYe/master
CorvusYe Dec 21, 2024
0934fa0
fix style
CorvusYe Dec 21, 2024
5f84655
Merge pull request #337 from CorvusYe/master
CorvusYe Dec 21, 2024
12b28e6
fix: `ng.valueFmt( value )` cannot output `null` as a placeholder whe…
CorvusYe Mar 4, 2025
d7bf627
chore: fix md lint and upgrade actions/cache
CorvusYe Mar 4, 2025
3bd3c22
fix: #339
CorvusYe Mar 4, 2025
4db3097
fix #63: automatically calculating stack and local variables in asm
moroyimk May 6, 2025
f5d414b
Merge pull request #344 from moroyimk/master
CorvusYe May 6, 2025
a91f358
Fix: Byte field type can't be properly valued
CorvusYe May 6, 2025
3d4af07
fix: fix the issue of `Duration` type in custom xml.
CorvusYe May 6, 2025
52d223a
Merge pull request #345 from CorvusYe/master
CorvusYe May 7, 2025
ddd5059
feat: support props can be directly mapped to entity objects.
CorvusYe May 7, 2025
d7e24a4
feat: make props directly mapped to entity objects can be config.
CorvusYe May 7, 2025
0f7809e
Merge pull request #347 from CorvusYe/master
CorvusYe May 17, 2025
7025041
feat: Supporting geometry types.
CorvusYe May 17, 2025
ed035f6
Merge pull request #348 from CorvusYe/master
CorvusYe May 17, 2025
b52f6fc
v2.0.1
CorvusYe Jun 6, 2025
af1f561
Fix: loss of null attribute caused by improper use of fastjson2. And …
CorvusYe Jun 6, 2025
b958982
Merge pull request #350 from CorvusYe/master
CorvusYe Jun 6, 2025
acfa5d4
ci: disable invalid database installation process
CorvusYe Jun 6, 2025
da4a370
Merge pull request #351 from CorvusYe/master
CorvusYe Jun 6, 2025
4713e19
lints: fix code style check
CorvusYe Jun 6, 2025
8bfb068
Merge pull request #352 from CorvusYe/master
CorvusYe Jun 6, 2025
967f6e1
fix: sessionQueue initialization
lakersUP Jul 11, 2025
839def9
Merge pull request #356 from lakersUP/master
CorvusYe Jul 11, 2025
2c3aec2
fix: use Maven Shade plugin to relocate fastjson2 package in ngbatis
dataPro-lgtm Aug 5, 2025
0e5b3f2
Merge pull request #358 from dataPro-lgtm/shaded-fastjson2
CorvusYe Sep 1, 2025
239f77a
feat: automatic conversion from Node/Relationship to NgVertex/NgEdge.
CorvusYe Dec 13, 2025
b91c314
Merge pull request #362 from CorvusYe/master
CorvusYe Dec 13, 2025
d6b4396
feat: expanding the `updateEdgeByIdBatchSelective` interface in `Nebu…
CorvusYe Dec 13, 2025
127ac81
Merge pull request #363 from CorvusYe/master
CorvusYe Dec 13, 2025
7d08247
fix: connection leak issue when an error occurs during execution.
CorvusYe Dec 13, 2025
b2822c1
Merge pull request #364 from CorvusYe/master
CorvusYe Dec 13, 2025
ff4296e
chore: code lint and release v2.1.0-beta.
CorvusYe Dec 13, 2025
b95bac8
Merge pull request #365 from CorvusYe/master
CorvusYe Dec 13, 2025
9cd6548
fix: <nGQL> fails to function properly when using `ng.include` across…
CorvusYe Dec 15, 2025
41fe455
lint: remove unnecessary class imports
CorvusYe Dec 15, 2025
632dff5
Merge pull request #367 from CorvusYe/master
CorvusYe Dec 15, 2025
454fa59
lint: NgTriplet.java constructor
CorvusYe Dec 15, 2025
1256b2d
Merge pull request #368 from CorvusYe/master
CorvusYe Dec 15, 2025
dae191c
Merge branch 'master' into for-jdk17
CorvusYe Feb 3, 2026
0daaa38
Merge the new features into the jdk17 version.
CorvusYe Feb 3, 2026
25abfca
Merge remote-tracking branch 'upstream/for-jdk17' into for-jdk17
CorvusYe Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
java-version: 1.8

- name: Cache the Maven packages to speed up build
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
with:
java-version: 17

- name: Install nebula-graph
run: |
mkdir tmp
pushd tmp
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
pushd nebula-docker-compose/
cp ../../src/test/resources/docker-compose.yaml .
docker compose up -d
sleep 30
docker compose ps
popd
popd
# - name: Install nebula-graph
# run: |
# mkdir tmp
# pushd tmp
# git clone https://github.com/vesoft-inc/nebula-docker-compose.git
# pushd nebula-docker-compose/
# cp ../../src/test/resources/docker-compose.yaml .
# docker compose up -d
# sleep 30
# docker compose ps
# popd
# popd

- name: Deploy Snapshot to Maven package
uses: samuelmeuli/action-maven-publish@v1
Expand Down
129 changes: 129 additions & 0 deletions CHANGELOG-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@

<!--
Copyright (c) 2024 All project authors and nebula-contrib. All rights reserved.

This source code is licensed under Apache 2.0 License.
-->

# 2.1.0-beta

## 新特性

- 支持复合对象属性类型为 NgEdge、NgVertex(含集合),不再需要另外定义 ResultHandler
- NebulaDaoBasic 拓展 updateEdgeByIdBatchSelective 接口,支持批量更新边(需自行控制单批数量)
- 拓展模板方法:ng.srcId、ng.dstId,分别读取 `@SrcId` `@DstId` 的属性值

> 如果项目中覆盖原来 beetl.properties,需追加新函数配置:
> ```diff
> + FN.ng.srcId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetSrcIdFn
> + FN.ng.dstId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetDstIdFn
> ```

## Bug修复

- 修复执行报错时产生连接未回收的泄漏问题
- 修复 ng.include 在多行的情况下,模板无法正常使用的问题

# 2.0.1

## Bug修复

- fix [#63](https://github.com/nebula-contrib/ngbatis/pull/63): 在 ASM 生成代理类时,自动计算方法的最大栈深及局部变量表个数。 来自: [@moroyimk](https://github.com/moroyimk)
- fix: 修复自定义 xml 中, `Duration` 作为属性类型不被支持的问题
- revert: 回退关于 2.0.0-beta.1 的修改。
> 为兼容 `${ ng.valueFmt( value ) }`, 当 value 为 null 时,依然可以输出占位符,可使用以下方式
>
> ```beetl
> ${ ng.valueFmt( value ) ! "null" }
> ```
>
- fix: 修复字段属性为 Byte 时,不能正常解析到实体对象的问题。

## 新特性

- 支持Geo类型

字段类型 | 属性类型
---|---
geo(point) | org.springframework.data.geo.Box
geo(linestring) | org.springframework.data.geo.Point
geo(polygon) | org.springframework.data.geo.Polygon
geo | Object

- 支持节点的属性对象字段可以与实体对象直接映射

```java
@Table(name = "column_alias")
public class ColumnAlias {
@Id @Column(name = "id_no") private String idNo;
@Column(name = "first_name") private String firstName;
@Column(name = "last_name") private String lastName;
@Transient private String ignoreMe;
}
```

```xml
<select id="propsToObj">
MATCH (n :column_alias)
WHERE n.column_alias.first_name is not null
RETURN
properties(n),
"ignoreMe" as ignoreMe
LIMIT 1
</select>
```

## Upgrade

- upgrade: 升级 fastjson 版本至 2.0.57.

# 2.0.0-beta.1

## Bugfix

- fix: 修复 `ng.valueFmt( value )` 中 value 为 null 时,无法输出 null 进行占位的问题。

# 2.0.0-beta

## Bug修复

- fix: [#329](https://github.com/nebula-contrib/ngbatis/issues/329) 修正返回值类型并明确接口泛型。[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
- fix: 移除 JDK8 的内部 API: ParameterizedTypeImpl

## 新特性

- feat: 实体直接搜索。 ([#319](https://github.com/nebula-contrib/ngbatis/pull/319), 来自:[@xYLiuuuuuu](https://github.com/n3A87))
- 实体可以继承 `GraphBaseVertex` 或 `GraphBaseEdge` 来支持直接搜索。
- GraphBaseVertex:

API | 用法说明
--|--
queryIdsByProperties() | 查询特定Tag或者属性的点Id集合
queryVertexById() | 查询特定点Id的单个点
queryVertexByTag() | 查询特定Tag的点集合
queryVertexByProperties() | 查询特定属性的点集合
queryAllAdjacentVertex(Class<?>... edgeClass) | 查询特定点的所有邻点集合,可指定一个或多个连接两点的边类型
queryIncomingAdjacentVertex(Class<?>... edgeClass) | 查询特定点入边方向的邻点集合,可指定一个或多个连接两点的边类型
queryOutgoingAdjacentVertex(Class<?>... edgeClass) | 查询特定点出边方向的邻点集合,可指定一个或多个连接两点的边类型
queryNeighborIdsWithHopById(int m, int n, Class<?>... edgeClass) | 查询特定点指定跳数内的点Id集合,可指定一个或多个连接两点的边类型
queryConnectedEdgesById(Direction direction) | 查询特定点关联的所有边集合,可指定边的方向和类型
queryPathFromVertex(Direction direction) | 查询特定点关联的所有路径集合,可指定边的方向
queryFixedLengthPathFromVertex(Integer maxHop, Direction direction, Class<?>... edgeClass) | 查询特定点出发的定长路径集合,可指定最大步数、边的方向、边的类型
queryVariableLengthPathFromVertex(Integer minHop, Integer maxHop, Direction direction, Class<?>... edgeClass) | 查询特定点出发的变长路径集合,可指定最小步数、最大步数、边的方向、边的类型
queryShortestPathFromSrcAndDst(Integer maxHop, Direction direction, T v2) | 查询特定点出发的任意一条最短路径,可指定步数、边的方向、终点实体
queryAllShortestPathsFromSrcAndDst(Integer maxHop, Direction direction, T v2) | 查询从该点出发的所有最短路径集合,可指定步数、边的方向、终点实体
queryVertexCountByTag() | 查询特定Tag的点的数量

- GraphBaseEdge:

API | 用法说明
--|--
queryEdgeByType(Direction direction) | 查询特定类型、方向的边集合
queryEdgeWithSrcAndDstByProperties(T srcVertex, Direction direction, T dstVertex) | 查询特定属性的边集合
queryEdgePropertiesBySrcAndDstId() | 查询特定始终点id的边集合
queryEdgeCountByType() | 查询特定Type的边的数量

- feat: 修复 [#324](https://github.com/nebulagraph/ngbatis/issues/324) 在 NebulaDaoBasic 中增加 insertForce(v) insertSelectiveForce(v)。[#335](https://github.com/nebula-contrib/ngbatis/pull/335)
- feat: @Space 注解和 Mapper xml 中的 space 配置支持动态配置。 ([#318](https://github.com/nebula-contrib/ngbatis/pull/318), 来自:[@charle004](https://github.com/charle004))
- feat: 支持 yml 中配置多个 mapper-locations。 ([#318](https://github.com/nebulagraph/ngbatis/pull/318), 来自:[@charle004](https://github.com/charle004))
- feat: SessionPool 支持使用 `spaceFromParam`进行运行时的图空间切换,包括运行后才创建的图空间。
142 changes: 137 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,139 @@ This source code is licensed under Apache 2.0 License.
- [ ] show metas
- [ ] create | alter tag & edge type
- [ ] index
- [ ] ResultSetUtil more column types support
- [ ] Geography
- [x] ResultSetUtil more column types support
- [x] Geography
- [x] Duration

## Dependencies upgrade

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

# NEXT
# 2.1.0-beta

## Features

- Support for composite object property types as NgEdge, NgVertex (including collections), no longer need to define ResultHandler separately

- NebulaDaoBasic extends updateEdgeByIdBatchSelective interface, supporting batch updates of edges (you need to control the quantity of each batch)

- Extended template methods: ng.srcId, ng.dstId, which read the property values of @SrcId and @DstId respectively

> If you override the original beetl.properties in your project, you need to add the new function configuration:
> ```diff
> + FN.ng.srcId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetSrcIdFn
> + FN.ng.dstId =org.nebula.contrib.ngbatis.binding.beetl.functions.GetDstIdFn
> ```

## Bugfix

- Fixed connection leak issue when an error occurs during execution.
- Fix the issue where the template fails to function properly when using `ng.include` across multiple lines.

# 2.0.1

## Bugfix

- fix ([#63](https://github.com/nebula-contrib/ngbatis/pull/63): automatically calculating stack and local variables in asm. via: [@moroyimk](https://github.com/moroyimk)
- fix: fix the issue of `Duration` type in custom xml
- revert: revert the change of 2.0.0-beta.1
> To be compatible with `${ ng.valueFmt( value ) }`, when value is null, it can still output a placeholder. You can use the following method:
>
> ```beetl
> ${ ng.valueFmt( value ) ! "null" }
> ```
>
- fix: fix the issue of field type is Byte, cannot be parsed to entity object.

## Feature

- Supporting geometry types.

db type | java type
---|---
geo(point) | org.springframework.data.geo.Box
geo(linestring) | org.springframework.data.geo.Point
geo(polygon) | org.springframework.data.geo.Polygon
geo | Object

- Supporting props can be directly mapped to entity objects.

```java
@Table(name = "column_alias")
public class ColumnAlias {
@Id @Column(name = "id_no") private String idNo;
@Column(name = "first_name") private String firstName;
@Column(name = "last_name") private String lastName;
@Transient private String ignoreMe;
}
```

```xml
<select id="propsToObj">
MATCH (n :column_alias)
WHERE n.column_alias.first_name is not null
RETURN
properties(n),
"ignoreMe" as ignoreMe
LIMIT 1
</select>
```

## Upgrade

- upgrade: upgrade fastjson version to 2.0.57.

# 2.0.0-beta.1

## Bugfix

- fix: `ng.valueFmt( value )` cannot output null as a placeholder when value is null.

# 2.0.0-beta

## Bugfix

- 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)
- fix: remove JDK8's internal API: ParameterizedTypeImpl

## Feature

- feat: Entity Direct Search. ([#319](https://github.com/nebula-contrib/ngbatis/pull/319), via: [@xYLiuuuuuu](https://github.com/n3A87))
- Entities can extend `GraphBaseVertex` or `GraphBaseEdge` to support direct search.
- GraphBaseVertex:

API | Usage instructions
--|--
queryIdsByProperties() | Query a collection of vertex ids for a particular Tag or attribute
queryVertexById() | Query a single vertex for a specific vertex Id
queryVertexByTag() | Query a collection of vertices for a specific Tag
queryVertexByProperties() | Query a collection of vertexes for a specific property
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
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
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
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
queryConnectedEdgesById(Direction direction) | Query the set of all edges associated with a particular vertex, specifying the direction and type of the edge
queryPathFromVertex(Direction direction) | Query the collection of all paths associated with a particular vertex, specifying the direction of the edge
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
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
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
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
queryVertexCountByTag() | Query the number of vertexes for a specific Tag

- GraphBaseEdge:

API | Usage instructions
--|--
queryEdgeByType(Direction direction) | Query a set of edges of a specific type and direction
queryEdgeWithSrcAndDstByProperties(T srcVertex, Direction direction, T dstVertex) | Query a set of edges for a particular property
queryEdgePropertiesBySrcAndDstId() | Query a set of edges for a specific always vertex id
queryEdgeCountByType() | Query the number of edges for a specific Type

- 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)
- 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))
> `@Space` 注解的 name 属性值和 xml 文件中 Mapper 标签指定的 Space 可通过 spring 配置文件自定义配置。
- feat: support multiple mapper-locations in yml. ([#318](https://github.com/nebula-contrib/ngbatis/pull/318), via: [@charle004](https://github.com/charle004))
- feat: SessionPool support `spaceFromParam`.

# 1.3.0

Expand Down Expand Up @@ -87,9 +211,9 @@ This source code is licensed under Apache 2.0 License.
person:
space: PERSON_SPACE
```

```java
@Space(name = "${nebula.space}")
@Space(name = "${app.person.space}")
@Table(name = "person")
public class Person {
@Id
Expand All @@ -114,6 +238,14 @@ This source code is licensed under Apache 2.0 License.
}
```

- XML example:

```xml
<mapper namespace="com.xxx.TestSpaceMapper" space="${app.person.space}">

</mapper>
```

# 1.2.2

## Bugfix
Expand Down
Loading
Loading