Class MongoDatabaseFactoryReferenceLoader
java.lang.Object
org.springframework.data.mongodb.core.convert.MongoDatabaseFactoryReferenceLoader
- All Implemented Interfaces:
ReferenceLoader
ReferenceLoader implementation using a MongoDatabaseFactory to obtain raw documents
for linked entities via a ReferenceLoader.DocumentReferenceQuery.- Since:
- 3.3
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from interface ReferenceLoader
ReferenceLoader.DocumentReferenceQuery, ReferenceLoader.NoResultsFilter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.bson.Document> fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocumentmatching the given referenceQuery in the context.protected com.mongodb.client.MongoCollection<org.bson.Document> Obtain theMongoCollectionfor a givenReferenceResolver.ReferenceCollectionfrom the underlyingMongoDatabaseFactory.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReferenceLoader
fetchOne
-
Constructor Details
-
MongoDatabaseFactoryReferenceLoader
- Parameters:
mongoDbFactory- must not be null.
-
-
Method Details
-
fetchMany
public Iterable<org.bson.Document> fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Description copied from interface:ReferenceLoaderObtain multipleDocumentmatching the given referenceQuery in the context.- Specified by:
fetchManyin interfaceReferenceLoader- Parameters:
referenceQuery- must not be null.context- must not be null.- Returns:
- the matching
Documentor null if none found.
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection(ReferenceResolver.ReferenceCollection context) Obtain theMongoCollectionfor a givenReferenceResolver.ReferenceCollectionfrom the underlyingMongoDatabaseFactory.- Parameters:
context- must not be null.- Returns:
- the
MongoCollectiontargeted by theReferenceResolver.ReferenceCollection.
-