Module spring.data.mongodb
Interface ReferenceResolver
- All Known Subinterfaces:
DbRefResolver
- All Known Implementing Classes:
DefaultDbRefResolver,DefaultReferenceResolver,NoOpDbRefResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The
ReferenceResolver allows to load and convert linked entities.- Since:
- 3.3
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDomain type conversion callback interface that allows to read thesourceobject into a mapped object.static classReferenceResolver.ReferenceCollectionis a value object that contains information about the target database and collection name of an association. -
Method Summary
Modifier and TypeMethodDescriptionresolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader) Resolve the association defined via the given property from a given source value.
-
Method Details
-
resolveReference
@Nullable Object resolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader) Resolve the association defined via the given property from a given source value. May return aproxy instancein case of a lazy loading association. The resolved value is assignable toPersistentProperty.getType().- Parameters:
property- the association defining property.source- the association source value.referenceLookupDelegate- the lookup executing component.entityReader- conversion function capable of constructing entities from raw source.- Returns:
- can be null.
-