Skip to content

Commit

Permalink
Let vertex and edge adapt simple json properties
Browse files Browse the repository at this point in the history
Implement #36

Change-Id: I500976931c50fbab384dbd71dbd839aa69dc42d3
  • Loading branch information
Linary committed Mar 13, 2019
1 parent ef118ea commit 363df59
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 27 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.baidu.hugegraph</groupId>
<artifactId>hugegraph-client</artifactId>
<version>1.6.8</version>
<version>1.6.9</version>
<packaging>jar</packaging>

<name>hugegraph-client</name>
Expand Down Expand Up @@ -112,7 +112,7 @@
<manifestEntries>
<!-- Must be on one line, otherwise the automatic
upgrade script cannot replace the version number -->
<Implementation-Version>1.6.8.0</Implementation-Version>
<Implementation-Version>1.6.9.0</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/baidu/hugegraph/client/RestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import com.baidu.hugegraph.exception.ServerException;
import com.baidu.hugegraph.rest.RestResult;
import com.baidu.hugegraph.serializer.PathDeserializer;
import com.baidu.hugegraph.serializer.VertexDeserializer;
import com.baidu.hugegraph.structure.graph.Path;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.fasterxml.jackson.databind.module.SimpleModule;

public class RestClient extends com.baidu.hugegraph.rest.RestClient {
Expand All @@ -35,7 +33,6 @@ public class RestClient extends com.baidu.hugegraph.rest.RestClient {

static {
SimpleModule module = new SimpleModule();
module.addDeserializer(Vertex.class, new VertexDeserializer());
module.addDeserializer(Path.class, new PathDeserializer());
RestResult.registerModule(module);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/baidu/hugegraph/driver/HugeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void initManagers(RestClient client, String graph) {
private void checkServerApiVersion() {
VersionUtil.Version apiVersion = VersionUtil.Version.of(
this.version.getApiVersion());
VersionUtil.check(apiVersion, "0.33", "0.34",
VersionUtil.check(apiVersion, "0.34", "0.35",
"hugegraph-api in server");
}

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/baidu/hugegraph/example/BatchExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ public static void main(String[] args) {
.ifNotExist()
.create();

schema.indexLabel("personByName")
.onV("person").by("name")
.secondary()
.ifNotExist()
.create();

schema.indexLabel("softwareByPrice")
.onV("software").by("price")
.range()
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/com/baidu/hugegraph/example/SingleExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ public static void main(String[] args) throws IOException {
.ifNotExist()
.create();

schema.indexLabel("personByName")
.onV("person")
.by("name")
.secondary()
.ifNotExist()
.create();

schema.indexLabel("personByCity")
.onV("person")
.by("city")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.JsonNodeType;

public class PathDeserializer extends JsonDeserializer<Path> {
Expand All @@ -41,9 +40,6 @@ public class PathDeserializer extends JsonDeserializer<Path> {

public PathDeserializer() {
this.mapper = new ObjectMapper();
SimpleModule module = new SimpleModule();
module.addDeserializer(Vertex.class, new VertexDeserializer());
this.mapper.registerModule(module);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import com.baidu.hugegraph.rest.SerializeException;
import com.baidu.hugegraph.serializer.PathDeserializer;
import com.baidu.hugegraph.serializer.VertexDeserializer;
import com.baidu.hugegraph.structure.graph.Edge;
import com.baidu.hugegraph.structure.graph.Path;
import com.baidu.hugegraph.structure.graph.Vertex;
Expand All @@ -46,7 +45,6 @@ public class ResultSet {

static {
SimpleModule module = new SimpleModule();
module.addDeserializer(Vertex.class, new VertexDeserializer());
module.addDeserializer(Path.class, new PathDeserializer());
mapper.registerModule(module);
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/com/baidu/hugegraph/unit/RestResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import com.baidu.hugegraph.rest.RestResult;
import com.baidu.hugegraph.serializer.PathDeserializer;
import com.baidu.hugegraph.serializer.VertexDeserializer;
import com.baidu.hugegraph.structure.constant.Cardinality;
import com.baidu.hugegraph.structure.constant.DataType;
import com.baidu.hugegraph.structure.constant.Frequency;
Expand Down Expand Up @@ -43,7 +42,6 @@ public class RestResultTest {
@BeforeClass
public static void init() {
SimpleModule module = new SimpleModule();
module.addDeserializer(Vertex.class, new VertexDeserializer());
module.addDeserializer(Path.class, new PathDeserializer());
RestResult.registerModule(module);
}
Expand Down

0 comments on commit 363df59

Please sign in to comment.