Releases: nebula-contrib/ngbatis
v2.0.1
2.0.1
Bugfix
- fix (#63: automatically calculating stack and local variables in asm. via: @moroyimk
- fix: fix the issue of
Durationtype 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:${ 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.
@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; }
<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.
更新日志
Bugfix
- fix #63: 在 ASM 生成代理类时,自动计算方法的最大栈深及局部变量表个数。 来自: @moroyimk
- fix: 修复自定义 xml 中,
Duration作为属性类型不被支持的问题 - revert: 回退关于 2.0.0-beta.1 的修改。
为兼容
${ ng.valueFmt( value ) }, 当 value 为 null 时,依然可以输出占位符,可使用以下方式${ 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 -
支持节点的属性对象字段可以与实体对象直接映射
@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; }
<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.
v2.0.0-beta
2.0.0-beta
Bugfix
- fix: #329 correct the return value type and clearly the interface generic.#335
- fix: remove JDK8's internal API: ParameterizedTypeImpl
Feature
-
feat: Entity Direct Search. (#319, via: @xYLiuuuuuu)
-
Entities can extend
GraphBaseVertexorGraphBaseEdgeto 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 add insertForce(v) insertSelectiveForce(v) into NebulaDaoBasic.#335
-
feat:
@Spaceannotation and space config in mapper xml supports dynamic configuration. (#318, via: @charle004)@Space注解的 name 属性值和 xml 文件中 Mapper 标签指定的 Space 可通过 spring 配置文件自定义配置。 -
feat: support multiple mapper-locations in yml. (#318, via: @charle004)
-
feat: SessionPool support
spaceFromParam.
2.0.0-beta
Bug修复
新特性
-
feat: 实体直接搜索。 (#319, 来自:@xYLiuuuuuu)
-
实体可以继承
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 在 NebulaDaoBasic 中增加 insertForce(v) insertSelectiveForce(v)。#335
-
feat:
@Space注解和 Mapper xml 中的 space 配置支持动态配置。 (#318, 来自:@charle004) -
feat: 支持 yml 中配置多个 mapper-locations。 (#318, 来自:@charle004)
-
feat: SessionPool 支持使用
spaceFromParam进行运行时的图空间切换,包括运行后才创建的图空间。
Full Changelog: v1.3.0...v2.0.0-beta
v1.3.0
What's Changed
Dependencies upgrade
- nebula-java: 3.6.0 -> 3.8.3
- org.hibernate:hibernate-core was excluded.
If you need to use hibernate-core, please add the dependency by yourself.
Bugfix
- fix: when
use-session-pooland spaceFromParam is true, skip the space addition. - fix: when timezone is not default, the time is incorrect.
- fix: allow normal startup without any mapper files.
- fix: Limit the node type obtained by
selectByIdto the entity class of the interface. - fix: When a node has multiple tags, prioritize using the tag of
resultType. (Collaborate with charle004, #311) - fix: debugging log output issue #312
Feature
-
feat: support the use of ciphertext passwords in yml.
-
feat: expanding the
insertSelectiveBatchinterface inNebulaDaoBasic.(#299, via Ozjq) -
feat: expanding the
shortestOptionalPathinterface inNebulaDaoBasic.(#303, via xYLiu) -
feat: expanding the
showSpacesinterface inNebulaDaoBasic.(#304, via xYLiu) -
feat: support ssl and http2 config in yml.
http2 属于企业版的数据库才支持,但我没有测试环境,所以不确定是否可用。
http2 is supported by the enterprise version of the database, but I don't have a test environment, so I'm not sure if it works. -
feat: support adding ID attributes of start and end nodes in edge entities.
通过
@DstId,@SrcId进行注解,可以将属性标记成特殊的属性,用于查询时可以填充的起始点和终点的id值。-
example:
nebula: pool-config: enable-ssl: true ssl-param: sign-mode: SELF_SIGNED crt-file-path: /path/to/client.crt key-file-path: /path/to/client.key password: password # ssl-param: # sign-mode: CA_SIGNED # ca-crt-file-path: /path/to/ca-client.crt # crt-file-path: /path/to/client.crt # key-file-path: /path/to/client.key use-http2: false custom-headers: Route-Tag: abc
-
-
feat:
@Spaceannotation supports dynamic configuration. .(#317, via charle004)@Space注解的 name 属性值可通过 spring 配置文件自定义配置。-
example:
app: person: space: PERSON_SPACE
@Space(name = "${nebula.space}") @Table(name = "person") public class Person { @Id private String vid; private String name; public String getVid() { return vid; } public void setVid(String vid) { this.vid = vid; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
-
New Contributors
- @Ozjq made their first contribution in #299
- @n3A87 made their first contribution in #303
- @charle004 made their first contribution in #311
Full Changelog: v1.2.2...v1.3.0
v1.2.2-jdk17
What's Changed
1.2.2
Bugfix
- fix: complete the error code of ResultSet into QueryException.
- fix: the issue of not being able to handle Set type.
- fix: the issue of the ranking value of the edge object cannot be filled.
- fix: when the field is aliased by
@Column, the param name is incorrect. (multi tags support)- selectBySelective
- selectIdBySelective
- selectBySelectiveStringLike
- selectIdBySelectiveStringLike
- fix: unable to read the correct value of id, the value of the subclass' id is used now. (multi tag scene)
- fix: do not generate asg debug when the log level is not debug, now.
Develop behavior change
- No longer verifying the number of
@Idin the entity, please keep the number to 1 on your own.不再对实体中的
@Id个数进行校验,请注意保持个数为1 (含父类)
1.2.1
Bugfix
- fix: set the specified space in the original method to the proxy method for paging. (#282)
Full Changelog: v1.2.0-jdk17...v1.2.2-jdk17
v1.2.2
What's Changed
1.2.2
Bugfix
- fix: complete the error code of ResultSet into QueryException.
- fix: the issue of not being able to handle Set type.
- fix: the issue of the ranking value of the edge object cannot be filled.
- fix: when the field is aliased by
@Column, the param name is incorrect. (multi tags support)- selectBySelective
- selectIdBySelective
- selectBySelectiveStringLike
- selectIdBySelectiveStringLike
- fix: unable to read the correct value of id, the value of the subclass' id is used now. (multi tag scene)
- fix: do not generate asg debug when the log level is not debug, now.
Develop behavior change
- No longer verifying the number of
@Idin the entity, please keep the number to 1 on your own.不再对实体中的
@Id个数进行校验,请注意保持个数为1 (含父类)
1.2.1
Bugfix
- fix: set the specified space in the original method to the proxy method for paging. (#282)
Full Changelog: v1.2.0...v1.2.2
v1.2.0-jdk17
What's Changed
- Draft: Upgrade to jdk 17 and SpringBoot 3.x by @omar-araboghli in #217
- for-jdk17 by @CorvusYe in #263
New Contributors
- @omar-araboghli made their first contribution in #217
Full Changelog: v1.2.0...v1.2.0-jdk17
v1.2.0
What's Changed
Dependencies upgrade
- nebula-java: 3.5.0 -> 3.6.0
- beetl: 3.1.8-RELEASE -> 3.15.10.RELEASE
- antlr4: 4.7.2 -> 4.11.1
- asm: 8.0 -> 9.4
- jsoup: 1.15.3 -> 1.15.4
Feature
- feat: support
<nGQL>include query pieces. (#212, via dieyi) - feat: extending
NgPath, when 'with prop' is used in nGQL, edge attributes can be obtained from NgPath. (#228, via dieyi) - feat: expanding the
insertEdgeBatchinterface inNebulaDaoBasic. (#244, via Sunhb) - feat: expanding the
deleteByIdBatchinterface inNebulaDaoBasic. (#247, via Sunhb) - feat: expanding the
listEndNodesinterface inNebulaDaoBasic. (#272, via knqiufan) - feat: support specify space by param
Bugfix
-
fix: support methods in mapper tags to set space to null.
- Such as:
<mapper namespace="..."> <create id="createSpace" space="null"> create space new_space ( vid_type = INT64 ); </create> </mapper>
-
fix: #190 Insert failed when tag has no attributes
-
chore: removing and exclude some packages: log4j related or useless.
-
fix: #194 we can name the interface by
@Componentand@Resource, for example:@Component("namedMapper"): use@Resource("namedMapper$Proxy")to inject. (since v1.0)@Resource("namedComponent"): use@Resource("namedComponent")to inject. (new feature)
-
fix: when DAO/Mapper method has
Pagetype param with@Param, the param name can not be use.如原来项目中分页相关接口,用了不起作用的
@Param, 但 xml 还是使用 p0, p1...
需要将@Param移除,或者将 xml 中的参数名改成 注解的参数名,以保证参数名统一 -
fix:class 'ResultSetUtil.java' parse datetime type error. (#241, via 爱吃辣条的Jerry)
-
fix: remove unnecessary reflections in transformDateTime, and prevents errors in the millisecond bit in jdk17.
Develop behavior change
- Remove deprecated classes and methods:
- org.nebula.contrib.ngbatis.binding.DateDeserializer
- org.nebula.contrib.ngbatis.binding.DefaultArgsResolver#customToJson
- Dependencies changing:
如果项目中有用到,且出现相关类找不到的情况,请自行引入
-
Exclude:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <exclusions> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> </exclusions> </dependency>
-
Removing:
<!-- Why: make it possible to use undertow as web server --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- Why: useless in NgBatis--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency>
-
New Contributors
- @1244453393 made their first contribution in #212
- @shbone made their first contribution in #235
- @bobobod made their first contribution in #241
- @syedzubeen made their first contribution in #250
- @knqiufan made their first contribution in #272
Full Changelog: v1.1.5...v1.2.0
v1.2.0-beta
Dependencies upgrade
- nebula-java: 3.5.0 -> 3.6.0
- beetl: 3.1.8-RELEASE -> 3.15.10.RELEASE
- antlr4: 4.7.2 -> 4.11.1
Feature
- feat: support
<nGQL>include query pieces. (#212, via dieyi) - feat: extending
NgPath, when 'with prop' is used in nGQL, edge attributes can be obtained from NgPath. (#228, via dieyi) - feat: expanding the
insertEdgeBatchinterface inNebulaDaoBasic. (#244, via Sunhb) - feat: expanding the
deleteByIdBatchinterface inNebulaDaoBasic. (#247, via Sunhb)
Bugfix
-
fix: support methods in mapper tags to set space to null.
- Such as:
<mapper namespace="..."> <create id="createSpace" space="null"> create space new_space ( vid_type = INT64 ); </create> </mapper>
-
fix: #190 Insert failed when tag has no attributes
-
chore: removing and exclude some packages: log4j related or useless.
-
fix: #194 we can name the interface by
@Componentand@Resource, for example:@Component("namedMapper"): use@Resource("namedMapper$Proxy")to inject. (since v1.0)@Resource("namedComponent"): use@Resource("namedComponent")to inject. (new feature)
-
fix: when DAO/Mapper method has
Pagetype param with@Param, the param name can not be use.如原来项目中分页相关接口,用了不起作用的
@Param, 但 xml 还是使用 p0, p1...
需要将@Param移除,或者将 xml 中的参数名改成 注解的参数名,以保证参数名统一 -
fix:class 'ResultSetUtil.java' parse datetime type error. (#241, via 爱吃辣条的Jerry)
Develop behavior change
- Remove deprecated classes and methods:
- org.nebula.contrib.ngbatis.binding.DateDeserializer
- org.nebula.contrib.ngbatis.binding.DefaultArgsResolver#customToJson
- Dependencies changing:
如果项目中有用到,且出现相关类找不到的情况,请自行引入
-
Exclude:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <exclusions> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> </exclusions> </dependency>
-
Removing:
<!-- Why: make it possible to use undertow as web server --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- Why: useless in NgBatis--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency>
-
New Contributors
- @1244453393 made their first contribution in #212
- @shbone made their first contribution in #235
- @bobobod made their first contribution in #241
- @syedzubeen made their first contribution in #250
Full Changelog: v1.1.5...v1.2.0-beta
v1.1.5
Bugfix
- fix: #176 use double quote instead of the original single quote in ng.valuaFmt function
- fix: #181 when node has multi tag, can not update by subclass
- updateById
- updateByIdSelective
- updateByIdBatchSelective
- updateByIdBatchSelective
- upsertByIdSelective
- fix: #185 improve the accuracy of datetime to milliseconds
v1.1.4
Develop behavior change.
- When a field is declared by java.util.Date, it is no longer allowed to set a value using Timestamp
当字段由java.util.Date声明时,不再允许使用java.sql.Timestamp设值
Bugfix
- fix: data error for date type in the database.#102
Feature
-
Clear time type mapping.
db type java type datetime java.util.Date date java.sql.Date time java.sql.Time timestamp java.sql.Timestamp duration java.time.Duration