diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBConfiguration.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBConfiguration.java index 1a2565f3c..e74cd0fc6 100644 --- a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBConfiguration.java +++ b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBConfiguration.java @@ -30,8 +30,7 @@ */ public abstract class ArangoDBConfiguration { - protected ArangoDB.Builder builder = new ArangoDB.Builder() - .serde(new JsonbSerde()); + protected ArangoDB.Builder builder = new ArangoDB.Builder(); /** * Adds a host in the arangodb builder @@ -93,13 +92,7 @@ public void setUseSSL(boolean value) { } /** - * Set the ArangoDB serde for the user data. Note that the provided - * serde must support serializing and deserializing JsonP types, - * i.e. {@link jakarta.json.JsonValue} and its children. - * By default, the builder is configured to use {@link JsonbSerde}; - * this setter allows overriding it, i.e. providing an instance of - * {@link JsonbSerde} that uses a specific {@link jakarta.json.bind.Jsonb} - * instance. + * Set the ArangoDB serde * * @param serde the serde */ diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/JsonbSerde.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/JsonbSerde.java deleted file mode 100644 index 248d2cd45..000000000 --- a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/JsonbSerde.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Michele Rastelli - */ -package org.eclipse.jnosql.databases.arangodb.communication; - -import com.arangodb.serde.ArangoSerde; -import jakarta.json.bind.Jsonb; -import org.eclipse.jnosql.communication.driver.JsonbSupplier; - -import java.nio.charset.StandardCharsets; - -/** - * ArangoDB user-data serde that serializes and deserializes user data using JSONB. - * This supports natively JsonP types, i.e. {@link jakarta.json.JsonValue} and its children. - */ -public class JsonbSerde implements ArangoSerde { - - private final Jsonb jsonb; - - public JsonbSerde() { - this(JsonbSupplier.getInstance().get()); - } - - /** - * Alternative constructor to provide {@link Jsonb} instance to use, - * i.e. using custom configuration, see {@link jakarta.json.bind.JsonbBuilder#create(jakarta.json.bind.JsonbConfig)} - * @param jsonb Jsonb - */ - public JsonbSerde(Jsonb jsonb) { - this.jsonb = jsonb; - } - - @Override - public byte[] serialize(Object value) { - return jsonb.toJson(value).getBytes(StandardCharsets.UTF_8); - } - - @Override - public T deserialize(byte[] content, Class type) { - return jsonb.fromJson(new String(content, StandardCharsets.UTF_8), type); - } - -} \ No newline at end of file