public interface DbRefResolver
DBRef.| Modifier and Type | Method and Description |
|---|---|
List<org.bson.Document> |
bulkFetch(List<com.mongodb.DBRef> dbRefs)
Loads a given
List of DBRefs from the datasource in one batch. |
default com.mongodb.DBRef |
createDbRef(DBRef annotation,
MongoPersistentEntity<?> entity,
Object id)
|
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. |
@Nullable Object resolveDbRef(MongoPersistentProperty property, @Nullable com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler)
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.property - will never be null.dbref - the DBRef to resolve.callback - will never be null.default com.mongodb.DBRef createDbRef(@Nullable DBRef annotation, MongoPersistentEntity<?> entity, Object id)
annotation - will never be null.entity - will never be null.id - will never be null.@Nullable org.bson.Document fetch(com.mongodb.DBRef dbRef)
DBRef from the datasource.dbRef - must not be null.List<org.bson.Document> bulkFetch(List<com.mongodb.DBRef> dbRefs)
List of DBRefs 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.dbRefs - must not be null.InvalidDataAccessApiUsageException - in case not all DBRef target the same collection.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.