Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
53d3b23
enabled CI tests for v7 branch
rashtao Jun 23, 2022
0448cd4
new serializer API
rashtao Jun 28, 2022
6a6f3a3
serde InternalModule
rashtao Jun 29, 2022
53ff374
serde serialization refactoring
rashtao Jun 29, 2022
db0835d
serde serialization refactoring: graph API
rashtao Jun 29, 2022
e40962f
serde serialization refactoring: collections API
rashtao Jun 29, 2022
5c25893
serde serialization refactoring: vertex collection API
rashtao Jun 30, 2022
07a6295
serde serialization refactoring: ArangoSearch API
rashtao Jun 30, 2022
f3c6dda
SerdeUtils
rashtao Jun 30, 2022
7df2e59
serde serialization refactoring: View API
rashtao Jun 30, 2022
e50aedf
serde serialization refactoring: ArangoJack
rashtao Jul 1, 2022
c2703cb
serde serialization refactoring: Collection API
rashtao Jul 1, 2022
6477ed4
JacksonSerde configuration
rashtao Jul 1, 2022
0ff7790
VPackSlice serializer
rashtao Jul 1, 2022
2e61252
serde serialization refactoring: Transactions API
rashtao Jul 1, 2022
ce9d295
serde serialization refactoring: Cursor API
rashtao Jul 1, 2022
e894791
ReplicationFactor refactoring
rashtao Jul 5, 2022
e781448
ArangoSerializer refactoring
rashtao Jul 5, 2022
77986cb
removed old ArangoSerialization
rashtao Jul 5, 2022
f2cb928
refctored communication API using byte[] instead of VPackSlice for ou…
rashtao Jul 6, 2022
9f0309a
serialize AQL bindvars as byte[]
rashtao Jul 8, 2022
9910876
separated ArangoSerialization from InternalSerialization
rashtao Jul 8, 2022
a9d0cd7
deserializer refactoring
rashtao Jul 8, 2022
075d0ab
deserializer refactoring: ArangoSearch
rashtao Jul 11, 2022
15c3b02
deserializer refactoring: Collections API
rashtao Jul 12, 2022
a654051
deserializer refactoring: Database API
rashtao Jul 12, 2022
390155f
deserializer refactoring: test fixes
rashtao Jul 12, 2022
1a0331d
removed usages of VPackSlice
rashtao Jul 12, 2022
4f20c73
removed velocypack related code
rashtao Jul 12, 2022
214ffca
reviewed API changes in entity and model packages
rashtao Jul 19, 2022
53dceb4
remove dependencies on com.arangodb.velocypack
rashtao Jul 19, 2022
df97d31
remove test dependencies on com.arangodb.velocypack
rashtao Jul 20, 2022
f56f5c6
removed old serialization classes
rashtao Jul 20, 2022
ed192e6
made data definition classes final
rashtao Jul 21, 2022
291445c
removed VPackSlice from javadoc
rashtao Jul 21, 2022
9c9d210
simplified serde API
rashtao Jul 21, 2022
821e4d7
removed CursorEntity from public API
rashtao Jul 22, 2022
9e10e8c
RawJson and RawBytes
rashtao Jul 22, 2022
9bf1808
refactoring: user serde inside internal serde
rashtao Jul 22, 2022
af633ae
removed support for raw json strings in favor of RawJson and RawBytes…
rashtao Jul 22, 2022
3f10d51
@UserData and @UserDataInside annotations
rashtao Jul 25, 2022
1143b8d
@UserData and @UserDataInside deserialization
rashtao Jul 26, 2022
f89eb88
fix cluster tests
rashtao Jul 26, 2022
8792566
replaced model arrays with collections
rashtao Jul 27, 2022
7124cf0
native image support
rashtao Jul 27, 2022
4b69a2f
removed VPack tests
rashtao Jul 28, 2022
e6930c6
removed dep on velocypack
rashtao Jul 28, 2022
6b5930c
implemented MapperProvider to isolate references to optional VPackMapper
rashtao Jul 28, 2022
4a1778b
serialize/deserialize JsonNode with internal serde
rashtao Jul 28, 2022
d43f900
date serde tests
rashtao Jul 28, 2022
680e7fe
test with different jackson versions
rashtao Jul 28, 2022
49dcdd5
JSON-B serde
rashtao Jul 29, 2022
c4fe603
fixed native tests
rashtao Aug 1, 2022
27775be
CI fixes
rashtao Aug 1, 2022
0c0478e
set JSON-B version 2.0.0 to be compatible with Java 8
rashtao Aug 1, 2022
272d4a6
set info log level for tests
rashtao Aug 1, 2022
35db024
fixed GraalVM tests
rashtao Aug 1, 2022
8d92c40
deps upd
rashtao Aug 1, 2022
8e7651f
maven flatten plugin
rashtao Aug 1, 2022
69b3aae
removed travis tests
rashtao Aug 1, 2022
0e90868
set default protocol to HTTP_JSON
rashtao Aug 1, 2022
da8dc41
[DE-295] removed DocumentCache
rashtao Aug 1, 2022
cb327d4
fixed maven variables clash
rashtao Aug 2, 2022
2d543ea
[DE-296] refactor BaseDocument
rashtao Aug 2, 2022
f0e33cf
fixed (de)serialize null user data
rashtao Aug 2, 2022
3646049
removed --allow-incomplete-classpath from native image configuration
rashtao Aug 2, 2022
4bc5ced
code cleanup
rashtao Aug 3, 2022
0e45426
removed unecessary deserializers
rashtao Aug 10, 2022
3bca4a7
[DE-313] Allow specifying the return type in CRUD document operations…
rashtao Aug 11, 2022
d99b124
deleteDocuments javadoc upd
rashtao Aug 11, 2022
b62666d
CRUD operations javadoc upd
rashtao Aug 11, 2022
63f21bd
removed unnecessary generics
rashtao Aug 15, 2022
2900beb
[DE-218] removed catchException API params
rashtao Aug 15, 2022
452a1b4
[DE-315] replace cursor stats with untyped map
rashtao Aug 15, 2022
cdb57b7
[DE-319] removed throws ArangoDBException declarations from API metho…
rashtao Aug 15, 2022
f3c5f15
serde API visibility refactoring
rashtao Aug 15, 2022
c5fe76e
[DE-327] removed unnecessary generics from vertex and edges collections
rashtao Aug 16, 2022
27206d2
removed misleading @SuppressWarnings
rashtao Aug 16, 2022
5bad5e8
added method and parameter to serde annotations targets
rashtao Aug 16, 2022
2c43ee8
re-enabled tests for documents with null values
rashtao Aug 16, 2022
0e18437
re-enabled assertions for createCollectionWithSmartJoinAttributeWrong…
rashtao Aug 16, 2022
eac5ea7
re-enabled queryWithTTL test
rashtao Aug 16, 2022
fccacdb
re-enabled ArangoEdgeCollectionTest test assertions
rashtao Aug 16, 2022
98f493d
re-enabled ArangoVertexCollectionTest test assertions
rashtao Aug 16, 2022
9315d74
code cleanup
rashtao Aug 16, 2022
50c0d5f
code analysis fixes
rashtao Aug 16, 2022
d0958e3
jacoco
rashtao Aug 16, 2022
f16f6fa
spotbugs
rashtao Aug 16, 2022
ebc6f7a
spotbugs fixes
rashtao Aug 16, 2022
831605f
codeql
rashtao Aug 16, 2022
7ea91e0
dev readme upd
rashtao Aug 16, 2022
7dcf791
[DE-330] added DocumentCreateOptions#keepNull
rashtao Aug 17, 2022
faff9e3
code cleanup
rashtao Aug 17, 2022
1d50ce7
sonarcloud
rashtao Aug 17, 2022
112b565
sonarcloud
rashtao Aug 17, 2022
dbee9a7
[DE-331] multi document operations from raw data (#450)
rashtao Aug 17, 2022
1c9fb19
code cleanup
rashtao Aug 17, 2022
8eba3ce
optional mvn deps
rashtao Aug 17, 2022
fd6223a
[DE-333] removed all occurrences of satellite() in pkg com.arangodb.m…
rashtao Aug 18, 2022
5fbd10b
added thread safety annotations (#445)
rashtao Aug 16, 2022
5e0ca56
CI fixes
rashtao Aug 18, 2022
f842796
CI: disabled shallow clone in sonar analysis job
rashtao Aug 19, 2022
af8c56a
CI updates
rashtao Aug 19, 2022
e75c767
Revert "optional mvn deps"
rashtao Aug 19, 2022
2ca213e
native image fixes
rashtao Aug 19, 2022
687fc41
deprecated fulltext index (DE-375) (#454)
rashtao Sep 7, 2022
786db3a
update test docker images
rashtao Sep 20, 2022
afaa14a
[DE-374] index cache
rashtao Sep 8, 2022
e8cf625
fixed tests for 3.10
rashtao Sep 20, 2022
d69af10
[DE-378] computed values
rashtao Sep 8, 2022
8a9534d
fixed tests for 3.10
rashtao Sep 8, 2022
af43f69
[DE-370] get query optimizer rules
rashtao Sep 8, 2022
389590e
[DE-376] geo index legacy polygons
rashtao Sep 8, 2022
b501a5c
[DE-377] test support for enterprise graphs
rashtao Sep 9, 2022
9073b31
[DE-373] index stored values
rashtao Sep 9, 2022
bc1c431
[DE-371] cluster dirty reads (#455)
rashtao Sep 9, 2022
c0e2bb6
[DE-382] inverted index (#457)
rashtao Sep 14, 2022
ace1ef2
test fixes
rashtao Sep 20, 2022
87566e2
[DE-380] fixed ConsolidationPolicy API
rashtao Sep 14, 2022
10ec28e
[DE-385] 3.10 analyzers (#458)
rashtao Sep 15, 2022
37c07c2
[DE-392] nested search support (#460)
rashtao Sep 15, 2022
7b710f6
[DE-384] search-alias views (#461)
rashtao Sep 16, 2022
1976e16
tests fixes
rashtao Sep 16, 2022
a7fb568
[DE-384] added SearchAliasIndex operation type
rashtao Sep 19, 2022
05f903e
enabled SmartGraphs tests for 3.10 single server
rashtao Sep 19, 2022
4d714bd
[DE-379] inverted indexes documentation
rashtao Sep 19, 2022
89b4861
tests fixes
rashtao Sep 19, 2022
f0b623b
fixed native image support
rashtao Sep 21, 2022
a7edf28
removed throws ArangoDBException declarations from API method signatures
rashtao Sep 21, 2022
ce76557
[DE-395] made managed classes final
rashtao Sep 22, 2022
6fda253
3.10 test fixes
rashtao Sep 22, 2022
7b97346
enabled ArangoSearchTest for 3.10 cluster
rashtao Sep 22, 2022
9934262
removed unecessary protected methods
rashtao Sep 23, 2022
212152b
moved JsonbSerde into test code
rashtao Sep 23, 2022
45080e3
updated changelog
rashtao Sep 27, 2022
407dad7
made BaseDocument final
rashtao Sep 27, 2022
090d7cc
made BaseDocument and BaseEdgeDocument serializable
rashtao Sep 27, 2022
9d18497
updated changelog
rashtao Sep 27, 2022
ea62484
[DE-399] added support for ConsolidationPolicy#minScore()
rashtao Sep 29, 2022
e5b18cd
detailed changes
rashtao Sep 28, 2022
3de86c4
removed ArangoCursorInitializer
rashtao Oct 5, 2022
9cd9a06
[DE-400] vertx webclient (#463)
rashtao Oct 18, 2022
a8fa889
removed ArangoContext
rashtao Oct 18, 2022
9b7a2bb
[DE-408] HTTP2 config
rashtao Oct 19, 2022
0d5f175
code cleanup
rashtao Oct 19, 2022
f0ee278
javadoc fixes
rashtao Oct 19, 2022
33e3963
[DE-409] fixed resiliency tests
rashtao Oct 19, 2022
c375979
benchmark logs
rashtao Oct 20, 2022
990dcfa
execute http request in vertx context
rashtao Oct 21, 2022
a99ff37
explicitly disabled Jackson default typing
rashtao Oct 21, 2022
1150c44
fixed query params encoding
rashtao Oct 21, 2022
46d1204
[DE-421] http debug logs
rashtao Oct 24, 2022
4500255
updated test docker images
rashtao Oct 24, 2022
38a6dce
[DE-414] removed default host 127.0.0.1
rashtao Oct 24, 2022
7c9ebcf
moved Request and Response classes under com.arangodb package
rashtao Oct 24, 2022
0bb27f2
added request id to ArangoDBException
rashtao Oct 25, 2022
8383c10
[DE-418] native tests
rashtao Oct 25, 2022
3a2f660
ssl CI tests
rashtao Oct 25, 2022
5de5b9d
native ssl CI tests
rashtao Oct 26, 2022
51dc2d4
fixed java 8 compilation
rashtao Oct 27, 2022
520342a
exceptions serialization test
rashtao Oct 27, 2022
a5d004d
code analysis fixes
rashtao Oct 27, 2022
55d55a4
set connections pool size
rashtao Oct 28, 2022
e49f9dc
connections parallelism test
rashtao Oct 28, 2022
62cf751
set http2 default maxConnections to 1
rashtao Oct 28, 2022
55784ed
disabled failing updateJwt in async tests (DE-423)
rashtao Oct 28, 2022
d36ade9
[DE-413] mvn multi module project (#465)
rashtao Nov 3, 2022
84e0cf1
fixed jwt tests
rashtao Nov 3, 2022
9341578
ConfigPropertiesProvider API (#466)
rashtao Nov 4, 2022
8888ef6
throw exception if ArangoDB.Builder.hosts is empty
rashtao Nov 4, 2022
5b15914
enterprise-hex-smart-vertex shardingStrategy (DE-422)
rashtao Nov 4, 2022
8f245db
[DE-417] resilience tests (#467)
rashtao Nov 7, 2022
5fe92e7
CI integration
rashtao Nov 7, 2022
8419f64
fixed ssl tests
rashtao Nov 7, 2022
588edbd
fixed CodeQL CI
rashtao Nov 7, 2022
e688c84
[DE-411] http retries (#468)
rashtao Nov 8, 2022
39b1b40
[DE-424] Bugfix HTTP shutdown (#469)
rashtao Nov 8, 2022
4ffadab
codeql fixes
rashtao Nov 8, 2022
4b1bfc0
tests fixes
rashtao Nov 8, 2022
9c9a808
codeql fixes
rashtao Nov 8, 2022
3f8f94f
[DE-426] execute generic parameterized request (#470)
rashtao Nov 9, 2022
3af6662
removed com.arangodb.Function
rashtao Nov 9, 2022
04db3b5
fixed 3.8 tests
rashtao Nov 10, 2022
e8218e4
PackageVersion
rashtao Nov 10, 2022
3944b0e
[DE-427] user agent
rashtao Nov 10, 2022
6a9a3ad
[DE-322] v7 documentation (#471)
rashtao Nov 10, 2022
81e5fec
[DE-322] tutorial
rashtao Nov 11, 2022
19c4d97
renamed ArangoDB.Builder.serializer to ArangoDB.Builder.serde
rashtao Nov 28, 2022
ee4a404
[DE-434] ArangoSearch cache
rashtao Nov 29, 2022
6bf4a70
updated test docker images
rashtao Nov 29, 2022
5d8dca6
deps upd
rashtao Dec 1, 2022
9de421a
fixed SerdeUtils logs
rashtao Dec 1, 2022
3d50654
fixed VST error handling
rashtao Dec 1, 2022
872aa02
added Jackson 2.14 to test matrix
rashtao Dec 1, 2022
275abf7
[DE-435] renamed user agent header
rashtao Dec 2, 2022
246aaf0
[DE-415] [DE-416] shaded package (#473)
rashtao Dec 8, 2022
24d79a1
fixed CI tests
rashtao Dec 8, 2022
e921d39
fixed java 8 tests
rashtao Dec 9, 2022
d253842
test fixes
rashtao Dec 9, 2022
1681588
static-code-analysis mvn profile
rashtao Dec 9, 2022
c48dcb9
test fixes
rashtao Dec 9, 2022
bd559ce
test fixes
rashtao Dec 9, 2022
d18f621
excluded tests from sonarcloud
rashtao Dec 9, 2022
3e646f4
fixed JacksonSerdeImpl
rashtao Dec 9, 2022
cf2a3e5
fixed native tests
rashtao Dec 9, 2022
4df778d
[DE-439] Shaded native image configuration (#475)
rashtao Dec 12, 2022
ebfb394
fixed shaded native tests CI
rashtao Dec 12, 2022
957af28
BaseDocument not serializable
rashtao Dec 12, 2022
ed386f7
removed deserializa by type from ArangoSerde
rashtao Dec 12, 2022
df64849
fixed native tests
rashtao Dec 12, 2022
729d880
mvn clean shaded pom
rashtao Dec 12, 2022
d3cd212
fixed flatten plugin order
rashtao Dec 12, 2022
e6ba67a
[DE-437] added jvm version to user agent header
rashtao Dec 15, 2022
6eeff5c
fixed VST debug logging
rashtao Dec 15, 2022
be57b9f
test fix: getIndexesShouldNotReturnInvertedIndexes()
rashtao Dec 16, 2022
3855127
[DE-445] JPMS compatibility (#477)
rashtao Dec 20, 2022
c47ab75
fixed mvn plugins versions
rashtao Dec 20, 2022
0ab2f19
added integration-tests as module
rashtao Dec 21, 2022
68fe1eb
[DE-322] v7 documentation (#478)
rashtao Dec 22, 2022
bc1de3d
fixed shaded javadoc
rashtao Dec 22, 2022
6b29cb7
fixed PackageVersionTest
rashtao Dec 22, 2022
da6c955
doc: mvn setup
rashtao Dec 22, 2022
72095da
default internal serde
rashtao Jan 3, 2023
7376e47
rm jackson-serde from shaded driver deps
rashtao Jan 3, 2023
80e1558
[DE-452] Typed Config (#480)
rashtao Jan 11, 2023
b5cba3e
log warn on internal serde
rashtao Jan 11, 2023
47513b5
re-added jackson-serde transitive dependency to shaded driver
rashtao Jan 11, 2023
cefe41b
tests fixes
rashtao Jan 11, 2023
484ad62
native tests fixes
rashtao Jan 11, 2023
e405cba
resilience tests fixes
rashtao Jan 11, 2023
55c256e
tests fixes
rashtao Jan 11, 2023
fbd3327
publish CI
rashtao Jan 12, 2023
a791127
v7.0.0-SNAPSHOT-2
rashtao Jan 12, 2023
adfbc64
deploy and release CI workflows (DE-438)
rashtao Jan 13, 2023
f729979
v7.0.0-ALPHA.1
rashtao Jan 13, 2023
bb1feb5
[DE-425] modules refactoring (#482)
rashtao Feb 16, 2023
91de964
[DE-425] jackson-serde-json and jackson-serde-vpack modules
rashtao Feb 17, 2023
b9a5c50
fixed empty javadoc
rashtao Feb 17, 2023
93dd0e4
fixed queueTime test
rashtao Feb 20, 2023
3a9980a
[DE-425] doc upd
rashtao Feb 20, 2023
349d00a
fixed empty jar in serde-vpack
rashtao Feb 20, 2023
97a0c22
internal serde annotations
rashtao Feb 20, 2023
75993fa
[DE-474] make BaseEdgeDocument extend BaseDocument
rashtao Feb 20, 2023
c61d706
[DE-473] cursor stats fullCount
rashtao Feb 20, 2023
2bcb2ba
[DE-436] reuse code in shaded integration tests
rashtao Feb 21, 2023
eda129b
[DE-436] reuse code in shaded integration tests
rashtao Feb 21, 2023
45e0118
[DE-436] reuse code in shaded integration tests
rashtao Feb 21, 2023
90c4d4e
fix native tests
rashtao Feb 21, 2023
b6c269b
rm references to vpack
rashtao Feb 21, 2023
5fe4834
test fix
rashtao Feb 21, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
@userdata and @UserDataInside annotations
  • Loading branch information
rashtao committed Aug 1, 2022
commit 3f10d510cd92cb1c65b9c2ff7cfe24c07194dfa8
4 changes: 4 additions & 0 deletions src/main/java/com/arangodb/entity/DocumentCreateEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package com.arangodb.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
* @author Mark Vollmary
* @see <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#create-document">API
Expand All @@ -41,6 +43,7 @@ public T getNew() {
return newDocument;
}

@JsonIgnore
public void setNew(final T newDocument) {
this.newDocument = newDocument;
}
Expand All @@ -53,6 +56,7 @@ public T getOld() {
return oldDocument;
}

@JsonIgnore
public void setOld(final T oldDocument) {
this.oldDocument = oldDocument;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/arangodb/entity/DocumentDeleteEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package com.arangodb.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
* @author Mark Vollmary
* @see <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#removes-a-document">API
Expand All @@ -41,6 +43,7 @@ public T getOld() {
return oldDocument;
}

@JsonIgnore
public void setOld(final T oldDocument) {
this.oldDocument = oldDocument;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/arangodb/entity/DocumentUpdateEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.arangodb.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand Down Expand Up @@ -50,6 +51,7 @@ public T getNew() {
return newDocument;
}

@JsonIgnore
public void setNew(final T newDocument) {
this.newDocument = newDocument;
}
Expand All @@ -62,6 +64,7 @@ public T getOld() {
return oldDocument;
}

@JsonIgnore
public void setOld(final T oldDocument) {
this.oldDocument = oldDocument;
}
Expand Down
28 changes: 5 additions & 23 deletions src/main/java/com/arangodb/internal/InternalArangoCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ protected <T> Request insertDocumentsRequest(final Collection<T> values, final D
request.putQueryParam(OVERWRITE_MODE, params.getOverwriteMode() != null ? params.getOverwriteMode().getValue() : null);
request.putQueryParam(MERGE_OBJECTS, params.getMergeObjects());
request.putHeaderParam(TRANSACTION_ID, params.getStreamTransactionId());

byte[] body = isStringCollection(values) ? getSerde().serialize(stringCollectionToJsonArray((Collection<String>) values))
: getSerde().serializeUserData(values);
request.setBody(body);
request.setBody(getSerde().serializeCollectionUserData(values));
return request;
}

Expand Down Expand Up @@ -181,9 +178,8 @@ protected Request importDocumentsRequest(final String values, final DocumentImpo
}

protected Request importDocumentsRequest(final Collection<?> values, final DocumentImportOptions options) {
byte[] body = isStringCollection(values) ? getSerde().serialize(stringCollectionToJsonArray((Collection<String>) values))
: getSerde().serializeUserData(values);
return importDocumentsRequest(options).putQueryParam("type", ImportType.list).setBody(body);
return importDocumentsRequest(options).putQueryParam("type", ImportType.list)
.setBody(getSerde().serializeCollectionUserData(values));
}

protected Request importDocumentsRequest(final DocumentImportOptions options) {
Expand Down Expand Up @@ -301,10 +297,7 @@ protected <T> Request replaceDocumentsRequest(final Collection<T> values, final
request.putQueryParam(RETURN_NEW, params.getReturnNew());
request.putQueryParam(RETURN_OLD, params.getReturnOld());
request.putQueryParam(SILENT, params.getSilent());

byte[] body = isStringCollection(values) ? getSerde().serialize(stringCollectionToJsonArray((Collection<String>) values))
: getSerde().serializeUserData(values);
request.setBody(body);
request.setBody(getSerde().serializeCollectionUserData(values));
return request;
}

Expand Down Expand Up @@ -402,10 +395,7 @@ protected <T> Request updateDocumentsRequest(final Collection<T> values, final D
request.putQueryParam(RETURN_NEW, params.getReturnNew());
request.putQueryParam(RETURN_OLD, params.getReturnOld());
request.putQueryParam(SILENT, params.getSilent());

byte[] body = isStringCollection(values) ? getSerde().serialize(stringCollectionToJsonArray((Collection<String>) values))
: getSerde().serializeUserData(values);
request.setBody(body);
request.setBody(getSerde().serializeCollectionUserData(values));
return request;
}

Expand Down Expand Up @@ -686,12 +676,4 @@ protected ResponseDeserializer<Permissions> getPermissionsResponseDeserialzer()
return response -> getSerde().deserialize(response.getBody(), ArangoResponseField.RESULT_JSON_POINTER, Permissions.class);
}

private boolean isStringCollection(final Collection<?> values) {
return values.stream().allMatch(String.class::isInstance);
}

private JsonNode stringCollectionToJsonArray(final Collection<String> values) {
return SerdeUtils.INSTANCE.parseJson("[" + String.join(",", values) + "]");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ protected ResponseDeserializer<Permissions> getPermissionsResponseDeserialzer()

protected Request queryRequest(final String query, final Map<String, Object> bindVars, final AqlQueryOptions options) {
final AqlQueryOptions opt = options != null ? options : new AqlQueryOptions();
final Request request = request(dbName, RequestType.POST, PATH_API_CURSOR).setBody(getSerde().serialize(
OptionsBuilder.build(opt, query, bindVars != null ? getSerde().serializeUserData(bindVars) : null)));
final Request request = request(dbName, RequestType.POST, PATH_API_CURSOR)
.setBody(getSerde().serialize(OptionsBuilder.build(opt, query, bindVars)));
if (opt.getAllowDirtyRead() == Boolean.TRUE) {
RequestUtils.allowDirtyRead(request);
}
Expand Down Expand Up @@ -190,8 +190,7 @@ protected Request queryCloseRequest(final String id, final AqlQueryOptions optio
protected Request explainQueryRequest(final String query, final Map<String, Object> bindVars, final AqlQueryExplainOptions options) {
final AqlQueryExplainOptions opt = options != null ? options : new AqlQueryExplainOptions();
return request(dbName, RequestType.POST, PATH_API_EXPLAIN)
.setBody(getSerde().serialize(
OptionsBuilder.build(opt, query, bindVars != null ? getSerde().serializeUserData(bindVars) : null)));
.setBody(getSerde().serialize(OptionsBuilder.build(opt, query, bindVars)));
}

protected Request parseQueryRequest(final String query) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/arangodb/model/AqlQueryExplainOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

package com.arangodb.model;

import com.arangodb.serde.InternalSerializers;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.arangodb.serde.UserDataInside;

import java.util.Collection;
import java.util.Map;

/**
* @author Mark Vollmary
Expand All @@ -32,24 +32,24 @@
*/
public final class AqlQueryExplainOptions {

private byte[] bindVars;
private Map<String, Object> bindVars;
private String query;
private Options options;

public AqlQueryExplainOptions() {
super();
}

@JsonSerialize(using = InternalSerializers.AqlBindVarsSerializer.class)
public byte[] getBindVars() {
@UserDataInside
public Map<String, Object> getBindVars() {
return bindVars;
}

/**
* @param bindVars key/value pairs representing the bind parameters
* @return options
*/
AqlQueryExplainOptions bindVars(final byte[] bindVars) {
AqlQueryExplainOptions bindVars(final Map<String, Object> bindVars) {
this.bindVars = bindVars;
return this;
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/arangodb/model/AqlQueryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

package com.arangodb.model;

import com.arangodb.serde.InternalSerializers;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.arangodb.serde.UserDataInside;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;

/**
* @author Mark Vollmary
Expand All @@ -40,7 +40,7 @@ public final class AqlQueryOptions {
private Integer batchSize;
private Boolean cache;
private Long memoryLimit;
private byte[] bindVars;
private Map<String, Object> bindVars;
private String query;
private Options options;
private Boolean allowDirtyRead;
Expand Down Expand Up @@ -147,16 +147,16 @@ public AqlQueryOptions fillBlockCache(final Boolean fillBlockCache) {
return this;
}

@JsonSerialize(using = InternalSerializers.AqlBindVarsSerializer.class)
public byte[] getBindVars() {
@UserDataInside
public Map<String, Object> getBindVars() {
return bindVars;
}

/**
* @param bindVarsBytes serialized bind parameters
* @return options
*/
AqlQueryOptions bindVars(final byte[] bindVarsBytes) {
AqlQueryOptions bindVars(final Map<String, Object> bindVarsBytes) {
this.bindVars = bindVarsBytes;
return this;
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/arangodb/model/OptionsBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.arangodb.entity.ViewType;

import java.util.Collection;
import java.util.Map;

/**
* @author Mark Vollmary
Expand Down Expand Up @@ -82,14 +83,14 @@ public static CollectionCreateOptions build(final CollectionCreateOptions option
return options.name(name);
}

public static AqlQueryOptions build(final AqlQueryOptions options, final String query, final byte[] bindVars) {
public static AqlQueryOptions build(final AqlQueryOptions options, final String query, final Map<String, Object> bindVars) {
return options.query(query).bindVars(bindVars);
}

public static AqlQueryExplainOptions build(
final AqlQueryExplainOptions options,
final String query,
final byte[] bindVars) {
final Map<String, Object> bindVars) {
return options.query(query).bindVars(bindVars);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.arangodb.serde;

import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;

class InternalAnnotationIntrospector extends JacksonAnnotationIntrospector {

private final UserDataSerializer userDataSerializer;

InternalAnnotationIntrospector(final UserDataSerializer userDataSerializer) {
this.userDataSerializer = userDataSerializer;
}

@Override
public Object findSerializer(Annotated a) {
if (a.getAnnotation(UserData.class) != null) {
return userDataSerializer;
} else {
return super.findSerializer(a);
}
}

@Override
public Object findContentSerializer(Annotated a) {
if (a.getAnnotation(UserDataInside.class) != null) {
return userDataSerializer;
} else {
return super.findContentSerializer(a);
}
}

}
9 changes: 9 additions & 0 deletions src/main/java/com/arangodb/serde/InternalSerde.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import java.lang.reflect.Type;
import java.util.Collection;

public interface InternalSerde extends JacksonSerde {

Expand Down Expand Up @@ -113,6 +114,14 @@ default <T> T deserialize(byte[] content, String jsonPointer, Type type) {
*/
byte[] serializeUserData(Object value);

/**
* Serializes each element in the collection using the user serde.
*
* @param value objects to serialize
* @return serialized byte array
*/
byte[] serializeCollectionUserData(Collection<?> value);

/**
* Deserializes the content and binds it to the target data type, using the user serde.
*
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/com/arangodb/serde/InternalSerdeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

final class InternalSerdeImpl extends JacksonSerdeImpl implements InternalSerde {

Expand All @@ -19,6 +22,7 @@ final class InternalSerdeImpl extends JacksonSerdeImpl implements InternalSerde
this.userSerde = userSerde;
mapper.registerModule(InternalModule.INSTANCE.get());
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.setAnnotationIntrospector(new InternalAnnotationIntrospector(new UserDataSerializer(this)));
}

@Override
Expand Down Expand Up @@ -60,13 +64,22 @@ public JsonNode parse(byte[] content, String jsonPointer) {

@Override
public byte[] serializeUserData(Object value) {
if (RawJson.class.equals(value.getClass()) || RawBytes.class.equals(value.getClass())) {
if (value != null && (RawJson.class.equals(value.getClass()) || RawBytes.class.equals(value.getClass()))) {
return serialize(value);
} else {
return userSerde.serialize(value);
}
}

@Override
public byte[] serializeCollectionUserData(Collection<?> value) {
List<JsonNode> jsonNodeCollection = value.stream()
.map(this::serializeUserData)
.map(this::parse)
.collect(Collectors.toList());
return serialize(jsonNodeCollection);
}

@Override
public <T> T deserializeUserData(byte[] content, Type type) {
if (RawJson.class.equals(type) || RawBytes.class.equals(type)) {
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/arangodb/serde/InternalSerializers.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@

public final class InternalSerializers {

public static class AqlBindVarsSerializer extends JsonSerializer<byte[]> {
@Override
public void serialize(byte[] value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
// TODO: find a way to append raw bytes directly
// see https://github.com/FasterXML/jackson-dataformats-binary/issues/331
try (JsonParser parser = gen.getCodec().getFactory().createParser(value)) {
gen.writeTree(parser.readValueAsTree());
}
}
}

public static class CollectionSchemaRuleSerializer extends JsonSerializer<String> {
@Override
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/arangodb/serde/UserData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.arangodb.serde;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marker annotation for fields that need to be serialized/deserialized using the user serde.
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface UserData {
}
Loading