public class MongoDatabaseFactoryReferenceLoader extends Object implements ReferenceLoader
ReferenceLoader
implementation using a MongoDatabaseFactory
to obtain raw documents
for linked entities via a ReferenceLoader.DocumentReferenceQuery
.ReferenceLoader.DocumentReferenceQuery
Constructor and Description |
---|
MongoDatabaseFactoryReferenceLoader(MongoDatabaseFactory mongoDbFactory) |
Modifier and Type | Method and Description |
---|---|
Iterable<org.bson.Document> |
fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery,
ReferenceResolver.ReferenceCollection context)
Obtain multiple
Document matching the given referenceQuery in the context. |
protected com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection(ReferenceResolver.ReferenceCollection context)
Obtain the
MongoCollection for a given ReferenceResolver.ReferenceCollection from the underlying
MongoDatabaseFactory . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fetchOne
public MongoDatabaseFactoryReferenceLoader(MongoDatabaseFactory mongoDbFactory)
mongoDbFactory
- must not be null.public Iterable<org.bson.Document> fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context)
ReferenceLoader
Document
matching the given referenceQuery in the context.fetchMany
in interface ReferenceLoader
referenceQuery
- must not be null.context
- must not be null.Document
or null if none found.protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection(ReferenceResolver.ReferenceCollection context)
MongoCollection
for a given ReferenceResolver.ReferenceCollection
from the underlying
MongoDatabaseFactory
.context
- must not be null.MongoCollection
targeted by the ReferenceResolver.ReferenceCollection
.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.