Skip to content

Commit c3bf2d5

Browse files
committed
javadoc upd
1 parent b36e0ef commit c3bf2d5

8 files changed

+81
-5
lines changed

ChangeLog.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
88

99
## [6.7.0_PREVIEW_3.7.1-alpha.1] - 2020-05-22
1010

11+
- added support of `DisjointSmartGraphs` and `SatelliteGraphs` (ArangoDB v3.7)
12+
- added support of `storedValues` in `ArangoSearchProperties` (ArangoDB v3.7)
13+
- added support of `primarySortCompression` in `ArangoSearchProperties` (ArangoDB v3.7)
14+
- added support of `overwriteMode` on document creation, to allow `insert-ignore`, `insert-replace` and `insert-update` (ArangoDB v3.7)
1115
- added support of `mergeObjects` for insert document with `overwriteMode: update` (ArangoDB v3.7)
12-
- added support of `DisjointSmartGraphs` (ArangoDB v3.7)
13-
- added support of `ArangoSearchProperties` value `storedValues` (ArangoDB v3.7)
14-
- added support of `ArangoSearchProperties` value `primarySortCompression` (ArangoDB v3.7)
15-
- added support of `overwriteMode` values `ignore` and `conflict` (ArangoDB v3.7)
1616
- velocypack v2.3.1
1717

1818
## [6.6.3] - 2020-05-06

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public CollectionType getType() {
6969
return type;
7070
}
7171

72+
/**
73+
* @return Optional object that specifies the collection level schema for documents.
74+
* @since ArangoDB 3.7
75+
*/
7276
public CollectionSchema getSchema() {
7377
return schema;
7478
}

src/main/java/com/arangodb/internal/velocypack/VPackSerializers.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ public class VPackSerializers {
209209
builder.close(); // close array
210210
}
211211

212-
213212
};
214213

215214
private static void serializeFieldLinks(final VPackBuilder builder, final Collection<FieldLink> links) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ public CollectionSchema getSchema() {
329329
return schema;
330330
}
331331

332+
/**
333+
* @param schema object that specifies the collection level schema for documents
334+
* @since ArangoDB 3.7
335+
* @return options
336+
*/
332337
public CollectionCreateOptions setSchema(final CollectionSchema schema) {
333338
this.schema = schema;
334339
return this;

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@
2424

2525
/**
2626
* @author Michele Rastelli
27+
* @see <a href="https://www.arangodb.com/docs/stable/data-modeling-documents-schema-validation.html">API Documentation</a>
28+
* @since ArangoDB 3.7
2729
*/
2830
public class CollectionSchema {
2931
private String rule;
3032
private Level level;
3133
private String message;
3234

35+
/**
36+
* @return JSON Schema description
37+
*/
3338
public String getRule() {
3439
return rule;
3540
}
@@ -39,6 +44,9 @@ public CollectionSchema setRule(String rule) {
3944
return this;
4045
}
4146

47+
/**
48+
* @return controls when the validation will be applied
49+
*/
4250
public Level getLevel() {
4351
return level;
4452
}
@@ -48,6 +56,9 @@ public CollectionSchema setLevel(Level level) {
4856
return this;
4957
}
5058

59+
/**
60+
* @return the message that will be used when validation fails
61+
*/
5162
public String getMessage() {
5263
return message;
5364
}
@@ -58,9 +69,28 @@ public CollectionSchema setMessage(String message) {
5869
}
5970

6071
public enum Level {
72+
73+
/**
74+
* The rule is inactive and validation thus turned off.
75+
*/
6176
NONE("none"),
77+
78+
/**
79+
* Only newly inserted documents are validated.
80+
*/
6281
NEW("new"),
82+
83+
/**
84+
* New and modified documents must pass validation, except for modified documents where the OLD value did not
85+
* pass validation already. This level is useful if you have documents which do not match your target structure,
86+
* but you want to stop the insertion of more invalid documents and prohibit that valid documents are changed to
87+
* invalid documents.
88+
*/
6389
MODERATE("moderate"),
90+
91+
/**
92+
* All new and modified document must strictly pass validation. No exceptions are made (default).
93+
*/
6494
STRICT("strict");
6595

6696
private final String value;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ public OverwriteMode getOverwriteMode() {
109109
* this option follows the rules of the overwrite parameter.
110110
* @return options
111111
* @since ArangoDB 3.7
112+
*
113+
* @implNote The current implementation has the following limitations:
114+
* - `keepNull` parameter is not supported
115+
* - the fields having {@code null} value are always removed during serialization
116+
* Therefore in case of {@link OverwriteMode#update}, existing attributes cannot be removed.
112117
*/
113118
public DocumentCreateOptions overwriteMode(final OverwriteMode overwriteMode) {
114119
this.overwriteMode = overwriteMode;
@@ -152,6 +157,8 @@ public Boolean getMergeObjects() {
152157
* document. If set to false, the value in the patch document will overwrite the existing document's
153158
* value. If set to true, objects will be merged. The default is true.
154159
* @return options
160+
* @since ArangoDB 3.7
161+
*
155162
* @apiNote only considered if {@link this#overwriteMode} is set to {@link OverwriteMode#update}
156163
*/
157164
public DocumentCreateOptions mergeObjects(Boolean mergeObjects) {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public Boolean getIsDisjoint() {
9898
return getOptions().getIsDisjoint();
9999
}
100100

101+
/**
102+
* @param isDisjoint If set to true, a Disjoint SmartGraph will be created. This flag is not editable after
103+
* creation. Default: false.
104+
* @return options
105+
* @since ArangoDB 3.7
106+
*/
101107
public GraphCreateOptions isDisjoint(final Boolean isDisjoint) {
102108
getOptions().setIsDisjoint(isDisjoint);
103109
return this;

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,36 @@
2323

2424
/**
2525
* @author Michele Rastelli
26+
* @since ArangoDB 3.7
2627
*/
2728
public enum OverwriteMode {
29+
30+
/**
31+
* if a document with the specified _key value exists already, nothing will be done and no write operation will be
32+
* carried out. The insert operation will return success in this case. This mode does not support returning the old
33+
* document version using RETURN OLD. When using RETURN NEW, null will be returned in case the document already
34+
* existed.
35+
*/
2836
ignore("ignore"),
37+
38+
/**
39+
* if a document with the specified _key value exists already, it will be overwritten with the specified document
40+
* value. This mode will also be used when no overwrite mode is specified but the overwrite flag is set to true.
41+
*/
2942
replace("replace"),
43+
44+
/**
45+
* if a document with the specified _key value exists already, it will be patched (partially updated) with the
46+
* specified document value. The overwrite mode can be further controlled via the keepNull and mergeObjects
47+
* parameters.
48+
*/
3049
update("update"),
50+
51+
/**
52+
* if a document with the specified _key value exists already, return a unique constraint violation error so that
53+
* the insert operation fails. This is also the default behavior in case the overwrite mode is not set, and the
54+
* overwrite flag is false or not set either.
55+
*/
3156
conflict("conflict");
3257

3358
private final String value;

0 commit comments

Comments
 (0)