Module spring.data.mongodb
Interface ReferenceLoader
- All Known Implementing Classes:
MongoDatabaseFactoryReferenceLoader
public interface ReferenceLoader
The
ReferenceLoader obtains raw documents for linked entities via a
ReferenceLoader.DocumentReferenceQuery.- Since:
- 3.3
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTheReferenceLoader.DocumentReferenceQuerydefines the criteria by whichdocumentsshould be matched applying potentially given order criteria.static enumA dedicatedReferenceLoader.DocumentReferenceQuerythat will not match any documents. -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.bson.Document>fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocumentmatching the given referenceQuery in the context.default org.bson.DocumentfetchOne(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain a singleDocumentmatching the given referenceQuery in the context.
-
Method Details
-
fetchOne
@Nullable default org.bson.Document fetchOne(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain a singleDocumentmatching the given referenceQuery in the context.- Parameters:
referenceQuery- must not be null.context- must not be null.- Returns:
- the matching
Documentor null if none found.
-
fetchMany
Iterable<org.bson.Document> fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocumentmatching the given referenceQuery in the context.- Parameters:
referenceQuery- must not be null.context- must not be null.- Returns:
- the matching
Documentor null if none found.
-