11package com .arangodb .serde ;
22
33import com .arangodb .ArangoDBException ;
4+ import com .arangodb .entity .BaseDocument ;
45import com .arangodb .util .RawBytes ;
56import com .arangodb .util .RawJson ;
67import com .fasterxml .jackson .annotation .JsonInclude ;
@@ -72,7 +73,11 @@ public JsonNode parse(byte[] content, String jsonPointer) {
7273 @ Override
7374 public byte [] serializeUserData (Object value ) {
7475 Class <?> clazz = value .getClass ();
75- if (RawJson .class .equals (clazz ) || RawBytes .class .equals (clazz ) || JsonNode .class .isAssignableFrom (clazz )) {
76+ if ( RawJson .class .equals (clazz ) ||
77+ RawBytes .class .equals (clazz ) ||
78+ JsonNode .class .isAssignableFrom (clazz ) ||
79+ BaseDocument .class .isAssignableFrom (clazz )
80+ ) {
7681 return serialize (value );
7782 } else {
7883 return userSerde .serialize (value );
@@ -90,7 +95,11 @@ public byte[] serializeCollectionUserData(Collection<?> value) {
9095
9196 @ Override
9297 public <T > T deserializeUserData (byte [] content , Class <T > clazz ) {
93- if (RawJson .class .isAssignableFrom (clazz ) || RawBytes .class .isAssignableFrom (clazz ) || JsonNode .class .isAssignableFrom (clazz )) {
98+ if ( RawJson .class .isAssignableFrom (clazz ) ||
99+ RawBytes .class .isAssignableFrom (clazz ) ||
100+ JsonNode .class .isAssignableFrom (clazz ) ||
101+ BaseDocument .class .isAssignableFrom (clazz )
102+ ) {
94103 return deserialize (content , clazz );
95104 } else {
96105 return userSerde .deserialize (content , clazz );
0 commit comments