From 32de1d437988359f87f3506eb982733b70fd5955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Fri, 15 Nov 2019 12:07:46 +0100 Subject: [PATCH] feat(client): allow to access the pojo codec repository of a collection --- .../java/io/quarkus/mongodb/ReactiveMongoCollection.java | 8 ++++++++ .../quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/ReactiveMongoCollection.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/ReactiveMongoCollection.java index d61b46be6504df..b669b13f4d9492 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/ReactiveMongoCollection.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/ReactiveMongoCollection.java @@ -4,6 +4,7 @@ import java.util.concurrent.CompletionStage; import org.bson.Document; +import org.bson.codecs.configuration.CodecRegistry; import org.bson.conversions.Bson; import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder; @@ -30,6 +31,13 @@ public interface ReactiveMongoCollection { */ MongoNamespace getNamespace(); + /** + * Gets the codec registry of this collection. + * + * @return the codec registry + */ + CodecRegistry getCodecRegistry(); + /** * Get the class of documents stored in this collection. * diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java index cf6c74a3f7106e..6a78aff2112fdd 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java @@ -4,6 +4,7 @@ import java.util.concurrent.CompletionStage; import org.bson.Document; +import org.bson.codecs.configuration.CodecRegistry; import org.bson.conversions.Bson; import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder; import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams; @@ -59,6 +60,11 @@ public MongoNamespace getNamespace() { return collection.getNamespace(); } + @Override + public CodecRegistry getCodecRegistry() { + return collection.getCodecRegistry(); + } + @Override public Class getDocumentClass() { return collection.getDocumentClass();