Enum Class NoOpDbRefResolver
- All Implemented Interfaces:
Serializable
,Comparable<NoOpDbRefResolver>
,Constable
,DbRefResolver
,ReferenceResolver
No-Operation
DBRef
resolver throwing
UnsupportedOperationException
when attempting to resolve database references.- Since:
- 2.1
- Author:
- Mark Paluch, Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.convert.ReferenceResolver
ReferenceResolver.MongoEntityReader, ReferenceResolver.ReferenceCollection
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionList<org.bson.Document>
Loads a givenList
ofDBRef
s from the datasource in one batch.org.bson.Document
fetch
(com.mongodb.DBRef dbRef) Actually loads theDBRef
from the datasource.resolveDbRef
(MongoPersistentProperty property, com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler) Resolves the givenDBRef
into an object of the givenMongoPersistentProperty
's type.resolveReference
(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader) Resolve the association defined via the given property from a given source value.static NoOpDbRefResolver
Returns the enum constant of this class with the specified name.static NoOpDbRefResolver[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.springframework.data.mongodb.core.convert.DbRefResolver
createDbRef
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
resolveDbRef
@Nullable public Object resolveDbRef(MongoPersistentProperty property, @Nullable com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler) Description copied from interface:DbRefResolver
Resolves the givenDBRef
into an object of the givenMongoPersistentProperty
's type. The method might return a proxy object for theDBRef
or resolve it immediately. In both cases theDbRefResolverCallback
will be used to obtain the actual backing object.- Specified by:
resolveDbRef
in interfaceDbRefResolver
- Parameters:
property
- will never be null.dbref
- theDBRef
to resolve.callback
- will never be null.- Returns:
- can be null.
-
fetch
Description copied from interface:DbRefResolver
Actually loads theDBRef
from the datasource.- Specified by:
fetch
in interfaceDbRefResolver
- Parameters:
dbRef
- must not be null.- Returns:
- can be null.
-
bulkFetch
Description copied from interface:DbRefResolver
Loads a givenList
ofDBRef
s from the datasource in one batch. The resultingList
ofDocument
will reflect the ordering of theDBRef
passed in.
TheDBRef
elements in the list must not reference different collections.- Specified by:
bulkFetch
in interfaceDbRefResolver
- Parameters:
dbRefs
- must not be null.- Returns:
- never null.
-
resolveReference
@Nullable public Object resolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader) Description copied from interface:ReferenceResolver
Resolve the association defined via the given property from a given source value. May return aproxy instance
in case of a lazy loading association. The resolved value is assignable toPersistentProperty.getType()
.- Specified by:
resolveReference
in interfaceReferenceResolver
- 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.
-