Skip to content

Commit 9ebd740

Browse files
author
Mark
committed
added smart graph support
1 parent d0a9b7f commit 9ebd740

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

src/main/java/com/arangodb/entity/GraphEntity.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class GraphEntity {
3131
private String name;
3232
private Collection<EdgeDefinition> edgeDefinitions;
3333
private Collection<String> orphanCollections;
34+
private Boolean isSmart;
35+
private Integer numberOfShards;
36+
private String smartGraphAttribute;
3437

3538
public String getName() {
3639
return name;
@@ -44,4 +47,16 @@ public Collection<String> getOrphanCollections() {
4447
return orphanCollections;
4548
}
4649

50+
public Boolean getIsSmart() {
51+
return isSmart;
52+
}
53+
54+
public Integer getNumberOfShards() {
55+
return numberOfShards;
56+
}
57+
58+
public String getSmartGraphAttribute() {
59+
return smartGraphAttribute;
60+
}
61+
4762
}

src/main/java/com/arangodb/model/GraphCreateOptions.java

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class GraphCreateOptions {
3535
private String name;
3636
private Collection<EdgeDefinition> edgeDefinitions;
3737
private Collection<String> orphanCollections;
38+
private Boolean isSmart;
39+
private SmartOptions options;
3840

3941
public GraphCreateOptions() {
4042
super();
@@ -72,4 +74,62 @@ public GraphCreateOptions orphanCollections(final String... orphanCollections) {
7274
return this;
7375
}
7476

77+
public Boolean getIsSmart() {
78+
return isSmart;
79+
}
80+
81+
public GraphCreateOptions isSmart(final Boolean isSmart) {
82+
this.isSmart = isSmart;
83+
return this;
84+
}
85+
86+
public Integer getNumberOfShards() {
87+
return getOptions().getNumberOfShards();
88+
}
89+
90+
public void numberOfShards(final Integer numberOfShards) {
91+
getOptions().setNumberOfShards(numberOfShards);
92+
}
93+
94+
public String getSmartGraphAttribute() {
95+
return getOptions().getSmartGraphAttribute();
96+
}
97+
98+
public void smartGraphAttribute(final String smartGraphAttribute) {
99+
getOptions().setSmartGraphAttribute(smartGraphAttribute);
100+
}
101+
102+
private SmartOptions getOptions() {
103+
if (options == null) {
104+
options = new SmartOptions();
105+
}
106+
return options;
107+
}
108+
109+
public static class SmartOptions {
110+
private Integer numberOfShards;
111+
private String smartGraphAttribute;
112+
113+
public SmartOptions() {
114+
super();
115+
}
116+
117+
public Integer getNumberOfShards() {
118+
return numberOfShards;
119+
}
120+
121+
public void setNumberOfShards(final Integer numberOfShards) {
122+
this.numberOfShards = numberOfShards;
123+
}
124+
125+
public String getSmartGraphAttribute() {
126+
return smartGraphAttribute;
127+
}
128+
129+
public void setSmartGraphAttribute(final String smartGraphAttribute) {
130+
this.smartGraphAttribute = smartGraphAttribute;
131+
}
132+
133+
}
134+
75135
}

0 commit comments

Comments
 (0)