public enum NoOpDbRefResolver extends Enum<NoOpDbRefResolver> implements DbRefResolver
DBRef
resolver throwing
UnsupportedOperationException
when attempting to resolve database references.ReferenceResolver.MongoEntityReader, ReferenceResolver.ReferenceCollection
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
List<org.bson.Document> |
bulkFetch(List<com.mongodb.DBRef> dbRefs)
Loads a given
List of DBRef s from the datasource in one batch. |
org.bson.Document |
fetch(com.mongodb.DBRef dbRef)
Actually loads the
DBRef from the datasource. |
Object |
resolveDbRef(MongoPersistentProperty property,
com.mongodb.DBRef dbref,
DbRefResolverCallback callback,
DbRefProxyHandler proxyHandler)
Resolves the given
DBRef into an object of the given MongoPersistentProperty 's type. |
Object |
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 |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NoOpDbRefResolver[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
createDbRef
public static final NoOpDbRefResolver INSTANCE
public static NoOpDbRefResolver[] values()
for (NoOpDbRefResolver c : NoOpDbRefResolver.values()) System.out.println(c);
public static NoOpDbRefResolver valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@Nullable public Object resolveDbRef(MongoPersistentProperty property, @Nullable com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler)
DbRefResolver
DBRef
into an object of the given MongoPersistentProperty
's type. The method
might return a proxy object for the DBRef
or resolve it immediately. In both cases the
DbRefResolverCallback
will be used to obtain the actual backing object.resolveDbRef
in interface DbRefResolver
property
- will never be null.dbref
- the DBRef
to resolve.callback
- will never be null.@Nullable public org.bson.Document fetch(com.mongodb.DBRef dbRef)
DbRefResolver
DBRef
from the datasource.fetch
in interface DbRefResolver
dbRef
- must not be null.public List<org.bson.Document> bulkFetch(List<com.mongodb.DBRef> dbRefs)
DbRefResolver
List
of DBRef
s from the datasource in one batch. The resulting List
of
Document
will reflect the ordering of the DBRef
passed in.DBRef
elements in the list must not reference different collections.bulkFetch
in interface DbRefResolver
dbRefs
- must not be null.@Nullable public Object resolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, ReferenceResolver.MongoEntityReader entityReader)
ReferenceResolver
proxy instance
in case of a lazy loading association. The resolved value is assignable to
PersistentProperty.getType()
.resolveReference
in interface ReferenceResolver
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.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.