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
Modifier and TypeInterfaceDescriptionstatic interface
TheReferenceLoader.DocumentReferenceQuery
defines the criteria by whichdocuments
should be matched applying potentially given order criteria.static enum
A dedicatedReferenceLoader.DocumentReferenceQuery
that will not match any documents. -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.bson.Document>
fetchMany
(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocument
matching the given referenceQuery in the context.default org.bson.Document
fetchOne
(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain a singleDocument
matching the given referenceQuery in the context.
-
Method Details
-
fetchOne
@Nullable default org.bson.Document fetchOne(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain a singleDocument
matching the given referenceQuery in the context.- Parameters:
referenceQuery
- must not be null.context
- must not be null.- Returns:
- the matching
Document
or null if none found.
-
fetchMany
Iterable<org.bson.Document> fetchMany(ReferenceLoader.DocumentReferenceQuery referenceQuery, ReferenceResolver.ReferenceCollection context) Obtain multipleDocument
matching the given referenceQuery in the context.- Parameters:
referenceQuery
- must not be null.context
- must not be null.- Returns:
- the matching
Document
or null if none found.
-