Skip to content

Commit

Permalink
Merge pull request #256 from CorvusYe/master
Browse files Browse the repository at this point in the history
v1.2.0-beta
  • Loading branch information
CorvusYe authored Nov 15, 2023
2 parents 7e3d38c + 4ecec68 commit ea999cd
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 16 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This source code is licensed under Apache 2.0 License.
- [ ] Expand the function of NebulaDaoBasic
- [ ] Add batch interface:
- [ ] insertTripletBatch
- [ ] insertEdgeBatch
- [x] insertEdgeBatch
- [ ] ...
- [ ] Schema support:
- [ ] show metas
Expand All @@ -26,14 +26,21 @@ This source code is licensed under Apache 2.0 License.

- [ ] Springboot 3.x support.

# NEXT
# 1.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](https://github.com/nebula-contrib/ngbatis/pull/212), via [dieyi](https://github.com/1244453393))
- feat: extending `NgPath`, when 'with prop' is used in nGQL, edge attributes can be obtained from NgPath. ([#228](https://github.com/nebula-contrib/ngbatis/pull/228), via [dieyi](https://github.com/1244453393))
- feat: expanding the `insertEdgeBatch` interface in `NebulaDaoBasic`. ([#244](https://github.com/nebula-contrib/ngbatis/pull/244), via [Sunhb](https://github.com/shbone))
- feat: expanding the `deleteByIdBatch` interface in `NebulaDaoBasic`. ([#247](https://github.com/nebula-contrib/ngbatis/pull/244), via [Sunhb](https://github.com/shbone))

## Bugfix

- fix: support methods in mapper tags to set space to null.
Expand All @@ -55,6 +62,7 @@ This source code is licensed under Apache 2.0 License.
- fix: when DAO/Mapper method has `Page` type 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](https://github.com/nebula-contrib/ngbatis/pull/241), via [爱吃辣条的Jerry](https://github.com/bobobod))

## Develop behavior change

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This source code is licensed under Apache 2.0 License.
</p>

- [Ngbatis Docs](https://nebula-contrib.github.io/ngbatis/)
- [Ngbatis 文档](https://corvusye.github.io/ngbatis-docs/)
- [Ngbatis 文档](https://graph-cn.github.io/ngbatis-docs/)

## What is NGBATIS

Expand Down
2 changes: 1 addition & 1 deletion ngbatis-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>org.nebula-contrib</groupId>
<artifactId>ngbatis</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0-beta</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
*/
public interface DropSpaceDao {

void createSpace(String name);
void useTestSpace();

void dropSpace(String name);
void createSpace();

void dropSpace();

List<String> showTags();

Expand Down
8 changes: 6 additions & 2 deletions ngbatis-demo/src/main/resources/mapper/DropSpaceDao.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
<mapper namespace="ye.weicheng.ngbatis.demo.repository.DropSpaceDao" space="test_drop">

<delete id="dropSpace">
drop space ${ p0 };
drop space test_drop;
</delete>

<select id="useTestSpace" space="test">
RETURN 1;
</select>

<select id="createSpace" space="null">
create space ${ p0 } ( vid_type = INT64 );
create space test_drop ( vid_type = INT64 );
</select>

<select id="showTags" resultType="java.lang.String">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class DropSpaceDaoTest {

@Test
void dropSpace() throws InterruptedException {
String spaceName = "test_drop";
dao.createSpace(spaceName);
dao.useTestSpace();
dao.createSpace();
Thread.sleep(10 * 1000);

List<String> tags = dao.showTags();
System.out.println(tags);

dao.dropSpace(spaceName);
dao.dropSpace();
}

}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<name>ngbatis</name>
<groupId>org.nebula-contrib</groupId>
<artifactId>ngbatis</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0-beta</version>

<developers>
<developer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private static String[] qlWithSpace(LocalSession localSession, String gql, Strin
gql = gql.trim();
String sessionSpace = localSession.getCurrentSpace();
boolean sameSpace = Objects.equals(sessionSpace, currentSpace);
if (!sameSpace) {
if (!sameSpace && currentSpace != null) {
qlAndSpace[0] = currentSpace;
Session session = localSession.getSession();
ResultSet execute = session.execute(String.format("USE `%s`", currentSpace));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ default int deleteLogicById(I id) {
* @param id 表记录主键
* @return 是否执行成功,成功 1 ,失败 0
*/
default int deleteWithEdgeById(I id) {
default Integer deleteWithEdgeById(I id) {
MethodModel methodModel = getMethodModel();
methodModel.setReturnType(ResultSet.class);
methodModel.setResultType(ResultSet.class);
Expand All @@ -306,7 +306,7 @@ default int deleteWithEdgeById(I id) {
* @param id 表记录主键
* @return 是否删除成功,成功 1,失败 0
*/
default int deleteById(I id) {
default Integer deleteById(I id) {
MethodModel methodModel = getMethodModel();
methodModel.setReturnType(ResultSet.class);
methodModel.setResultType(ResultSet.class);
Expand All @@ -322,7 +322,7 @@ default int deleteById(I id) {
* @param ids 表记录主键列表
* @return 是否删除成功,成功 1,失败 0
*/
default int deleteByIdBatch(Collection<I> ids) {
default Integer deleteByIdBatch(Collection<I> ids) {
MethodModel methodModel = getMethodModel();
methodModel.setReturnType(ResultSet.class);
methodModel.setResultType(ResultSet.class);
Expand Down

0 comments on commit ea999cd

Please sign in to comment.