Class ReferenceLookupDelegate
java.lang.Object
org.springframework.data.mongodb.core.convert.ReferenceLookupDelegate
A common delegate for
ReferenceResolver
implementations to resolve a reference to one/many target documents
that are converted to entities.- Since:
- 3.3
- Author:
- Christoph Strobl, Mark Paluch, Stefan Bildl
-
Constructor Summary
ConstructorDescriptionReferenceLookupDelegate
(MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext, SpELContext spELContext) Create a newReferenceLookupDelegate
. -
Method Summary
Modifier and TypeMethodDescriptionreadReference
(MongoPersistentProperty property, Object source, org.springframework.data.mongodb.core.convert.ReferenceLookupDelegate.LookupFunction lookupFunction, ReferenceResolver.MongoEntityReader entityReader) Read the reference expressed by the given property.
-
Constructor Details
-
ReferenceLookupDelegate
public ReferenceLookupDelegate(MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext, SpELContext spELContext) Create a newReferenceLookupDelegate
.- Parameters:
mappingContext
- must not be null.spELContext
- must not be null.
-
-
Method Details
-
readReference
@Nullable public Object readReference(MongoPersistentProperty property, Object source, org.springframework.data.mongodb.core.convert.ReferenceLookupDelegate.LookupFunction lookupFunction, ReferenceResolver.MongoEntityReader entityReader) Read the reference expressed by the given property.- Parameters:
property
- the reference defining property. Must not be null. THesource
- the source value identifying to the referenced entity. Must not be null.lookupFunction
- to execute a lookup query. Must not be null.entityReader
- the callback to convert raw source values into actual domain types. Must not be null.- Returns:
- can be null.
-