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 org.springframework.data.mongodb.core.convert.ReferenceLoader
ReferenceLoader.DocumentReferenceQuery, ReferenceLoader.NoResultsFilter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIterable<org.bson.Document>
fetchMany
(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocument
matching the given referenceQuery in the context.protected com.mongodb.client.MongoCollection<org.bson.Document>
Obtain theMongoCollection
for a givenReferenceResolver.ReferenceCollection
from the underlyingMongoDatabaseFactory
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mongodb.core.convert.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:ReferenceLoader
Obtain multipleDocument
matching the given referenceQuery in the context.- Specified by:
fetchMany
in interfaceReferenceLoader
- Parameters:
referenceQuery
- must not be null.context
- must not be null.- Returns:
- the matching
Document
or null if none found.
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection(ReferenceResolver.ReferenceCollection context) Obtain theMongoCollection
for a givenReferenceResolver.ReferenceCollection
from the underlyingMongoDatabaseFactory
.- Parameters:
context
- must not be null.- Returns:
- the
MongoCollection
targeted by theReferenceResolver.ReferenceCollection
.
-