@@ -46,29 +46,31 @@ stores, frameworks integrations, etc.
4646An implementation for loading properties from local files is provided by ` ArangoConfigProperties.fromFile() ` and its
4747overloaded variants.
4848
49- To read config properties from ` arangodb.properties ` file (as in version ` 6 ` ):
49+ To read config properties prefixed with ` arangodb ` from ` arangodb.properties ` file (as in version ` 6 ` ):
5050
5151``` java
52- ArangoDB adb = new ArangoDB .Builder ()
53- .loadProperties(ArangoConfigProperties . fromFile()) // reads "arangodb.properties" by default
54- // ...
55- .build();
52+ // ## src/main/resources/arangodb.properties
53+ // arangodb.hosts=172.28.0.1:8529
54+ // arangodb.password=test
55+ // ...
56+
57+ ArangoConfigProperties props = ArangoConfigProperties . fromFile();
5658```
5759
5860To read config properties from ` arangodb-with-prefix.properties ` file, where the config properties
5961are prefixed with ` adb ` :
6062
6163``` java
62- // ## arangodb-with-prefix.properties
64+ // ## src/main/resources/ arangodb-with-prefix.properties
6365// adb.hosts=172.28.0.1:8529
64- // adb.acquireHostList=true
66+ // adb.password=test
6567// ...
6668
67- ArangoDB adb = new ArangoDB .Builder ()
68- .loadProperties(ArangoConfigProperties . fromFile(" arangodb-with-prefix.properties" , " adb" ))
69- .build();
69+ ArangoConfigProperties props = ArangoConfigProperties . fromFile(" arangodb-with-prefix.properties" , " adb" );
7070```
7171
72+ Related reference documentation can be found [ here] ( ./v7_java-reference-setup.md#config-file-properties ) .
73+
7274Here are some examples showing how to provide configuration properties from different sources:
7375- [ Eclipse MicroProfile Config] ( https://github.com/arangodb-helper/arango-quarkus-native-example/blob/master/src/main/java/org/acme/quickstart/ArangoConfig.java )
7476- [ Micronaut Configuration] ( https://github.com/arangodb-helper/arango-micronaut-native-example/blob/main/src/main/kotlin/com/example/ArangoConfig.kt )
@@ -79,12 +81,13 @@ Here are some examples showing how to provide configuration properties from diff
7981Support for different serdes and communication protocols is offered by separate modules.
8082Defaults modules are transitively included, but they could be excluded if not needed.
8183
82- The driver artifact ` com.arangodb:arangodb-java-driver ` has transitive dependencies on default modules:
84+ The main driver artifact ` com.arangodb:arangodb-java-driver ` has transitive dependencies on default modules:
8385- ` com.arangodb:http-protocol ` : ` HTTP ` communication protocol (HTTP/1.1 and HTTP/2)
84- - ` com.arangodb:jackson-serde-json ` : ` JSON ` ` user-data serde ` module based on Jackson Databind
86+ - ` com.arangodb:jackson-serde-json ` : ` JSON ` user-data serde module based on Jackson Databind
87+
8588Alternative modules are respectively:
8689- ` com.arangodb:vst-protocol ` : ` VST ` communication protocol
87- - ` com.arangodb:jackson-serde-vpack ` : ` VPACK ` ` user-data serde ` module based on Jackson Databind
90+ - ` com.arangodb:jackson-serde-vpack ` : ` VPACK ` user-data serde module based on Jackson Databind
8891
8992The modules above are discovered and loaded using SPI (Service Provider Interface).
9093
@@ -94,6 +97,7 @@ and the corresponding default module(s) can be excluded.
9497For example, to use the driver with ` VPACK ` over ` VST ` , we must include:
9598- ` com.arangodb:vst-protocol ` and
9699- ` com.arangodb:jackson-serde-vpack `
100+
97101and can exclude:
98102- ` com.arangodb:http-protocol ` and
99103- ` com.arangodb:jackson-serde-json `
@@ -137,7 +141,7 @@ The versions of such libraries can be overridden, the driver is compatible with
137141
138142To do this, you might need to include [ jackson-bom] ( https://github.com/FasterXML/jackson-bom )
139143to ensure dependency convergence across the entire project, for example in case
140- there are in your project other libraries depending on different versions of Jackson.
144+ there are in your project other libraries depending on different versions of Jackson:
141145
142146``` xml
143147<dependencyManagement >
@@ -156,20 +160,20 @@ there are in your project other libraries depending on different versions of Jac
156160The module ` http-protocol ` has transitive dependency on ` io.vertx:vertx-web-client:4.3.5 ` , which in turn depends on
157161packages from ` io.netty ` .
158162
159- If these dependency requirements cannot be satisfied, you might need to use the
160- [ shaded version] ( #arangodb-java-driver-shaded ) of this driver, which bundles together all modules with relocated
163+ If these dependency requirements cannot be satisfied, i.e. they cause convergence conflicts with other versions of same
164+ packages in the classpath, you might need to use the
165+ [ shaded version] ( #arangodb-java-driver-shaded ) of this driver, which bundles all modules together with relocated
161166external dependencies.
162167
163- The dependency on ` com.arangodb:velocypack ` has been removed from core module and is now only used
164- by ` com.arangodb:vst-protocol ` and ` com.arangodb:jackson-serde-vpack ` , thus only for ` VST ` protocol or ` VPACK ` content
165- type.
166-
168+ The dependency on ` com.arangodb:velocypack ` has been removed from core module and is now only used as internal
169+ dependency by ` com.arangodb:vst-protocol ` and ` com.arangodb:jackson-serde-vpack ` , thus transitively imported only when
170+ using ` VST ` protocol or ` VPACK ` content type.
167171
168172## User Data
169173
170- Before version ` 7.0 ` the driver always parsed raw strings as JSON, but unfortunately this does not allow to distinguish
174+ Before version ` 7.0 ` the driver always parsed raw strings as JSON, but unfortunately this did not allow to distinguish
171175it from the case when the intent is to use the raw string as such, without parsing it. Since version ` 7.0 ` , strings are
172- not interpreted as JSON anymore. To represent user data as raw JSON, the wrapper class ` com.arangodb.util.RawJson ` has
176+ not interpreted as JSON anymore. To represent user- data as raw JSON, the wrapper class ` com.arangodb.util.RawJson ` has
173177been added:
174178
175179``` java
@@ -181,7 +185,7 @@ RawJson rawJsonOut = res.next();
181185String json = rawJsonOut. get(); // {"foo":"bar"}
182186```
183187
184- To represent user data already encoded as byte array, the wrapper class ` RawBytes ` has been added.
188+ To represent user- data already encoded as byte array, the wrapper class ` RawBytes ` has been added.
185189The byte array can either represent a ` JSON ` string (UTF-8 encoded) or a ` VPACK ` value. The format used should match the
186190driver protocol configuration (` JSON ` for ` HTTP_JSON ` and ` HTTP2_JSON ` , ` VPACK ` otherwise).
187191
@@ -223,8 +227,9 @@ include databind functionalities anymore. It only offers a lower level API to de
223227[ ` jackson-dataformat-velocypack ` ] ( https://github.com/arangodb/jackson-dataformat-velocypack ) , which is a Jackson backend
224228for ` VPACK ` dataformat.
225229
226- The user data custom serializer implementation ` ArangoJack ` has been removed in favor of
227- ` com.arangodb.serde.jackson.JacksonSerde ` .
230+ The user-data custom serializer implementation ` ArangoJack ` has been removed in favor of
231+ ` com.arangodb.serde.jackson.JacksonSerde ` . This allows using Jackson API to serialize and deserialize user-data,
232+ compatible with both ` JSON ` and ` VPACK ` .
228233
229234Detailed documentation about serialization can be found [ here] ( v7_java-reference-serialization.md ) .
230235
@@ -252,8 +257,13 @@ ArangoDB documents metadata (`_id`, `_key`, `_rev`, `_from`, `_to`):
252257- ` @InternalFrom `
253258- ` @InternalTo `
254259
255- These annotations are compatible with the shaded ** internal serde** .
256-
260+ These annotations are compatible with relocated Jackson classes.
261+ Note that the ** internal serde** is not part of the public API and could change in future releases without notice, thus
262+ breaking client applications relying on it to serialize or deserialize user-data. It is therefore recommended also in
263+ this case either:
264+ - using the default user-data serde ` JacksonSerde ` (from packages ` com.arangodb:jackson-serde-json ` or
265+ ` com.arangodb:jackson-serde-vpack ` ), or
266+ - providing a custom user-data serde implementation via ` ArangoDB.Builder.serde(ArangoSerde) ` .
257267
258268## Removed APIs
259269
@@ -268,7 +278,7 @@ The following client APIs have been removed:
268278 - ` overwrite ` flag in ` DocumentCreateOptions `
269279 - ` hash ` and ` skipList ` indexes
270280
271- The user data custom serializer implementation ` ArangoJack ` has been removed in favor of
281+ The user- data custom serializer implementation ` ArangoJack ` has been removed in favor of
272282` com.arangodb.serde.jackson.JacksonSerde ` .
273283
274284Support for interpreting raw strings as JSON has been removed (in favor of ` com.arangodb.util.RawJson ` ).
@@ -280,6 +290,7 @@ Raw `VPACK` data can be used now with `com.arangodb.util.RawBytes`).
280290Support for custom initialization of
281291cursors (` ArangoDB._setCursorInitializer(ArangoCursorInitializer cursorInitializer) ` ) has been removed.
282292
293+
283294### Async API
284295
285296The asynchronous API (before under the package ` com.arangodb.async ` ) has been removed from version 7.0 (#487 ).
@@ -292,7 +303,7 @@ It will be reworked and re-added in a future version 7.x.
292303
293304Before version ` 7.0 ` some CRUD API methods inferred the return type from the type of the data object passed as input.
294305Now the return type can be explicitly set for each CRUD API method. This type is used as deserialization target by
295- the ` user-data serde ` . In particular, no automatic type inference is performed anymore in:
306+ the user-data serde. In particular, no automatic type inference is performed anymore in:
296307- ` ArangoCollection.insertDocuments() `
297308- ` ArangoCollection.replaceDocuments() `
298309- ` ArangoCollection.updateDocuments() `
@@ -356,7 +367,7 @@ Examples can be found here:
356367
357368## Migration
358369
359- To migrate your existing project to Java Driver version ` 7.0 ` , it is recommended updating to the latest version of
370+ To migrate your existing project to Java Driver version ` 7.0 ` , it is recommended first updating to the latest version of
360371branch ` 6 ` and make sure that your code does not use any deprecated API.
361372This can be done by checking the presence of deprecation warnings in the Java compiler output.
362373
0 commit comments