Module spring.data.mongodb
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
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionList<org.bson.Document>Loads a givenListofDBRefs from the datasource in one batch.org.bson.Documentfetch(com.mongodb.DBRef dbRef) Actually loads theDBReffrom the datasource.resolveDbRef(MongoPersistentProperty property, com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler) Resolves the givenDBRefinto 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 NoOpDbRefResolverReturns 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, valueOfMethods 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:DbRefResolverResolves the givenDBRefinto an object of the givenMongoPersistentProperty's type. The method might return a proxy object for theDBRefor resolve it immediately. In both cases theDbRefResolverCallbackwill be used to obtain the actual backing object.- Specified by:
resolveDbRefin interfaceDbRefResolver- Parameters:
property- will never be null.dbref- theDBRefto resolve.callback- will never be null.- Returns:
- can be null.
-
fetch
Description copied from interface:DbRefResolverActually loads theDBReffrom the datasource.- Specified by:
fetchin interfaceDbRefResolver- Parameters:
dbRef- must not be null.- Returns:
- can be null.
-
bulkFetch
Description copied from interface:DbRefResolverLoads a givenListofDBRefs from the datasource in one batch. The resultingListofDocumentwill reflect the ordering of theDBRefpassed in.
TheDBRefelements in the list must not reference different collections.- Specified by:
bulkFetchin 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:ReferenceResolverResolve 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().- Specified by:
resolveReferencein 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.
-