public class DefaultDbRefResolver extends Object implements DbRefResolver
DbRefResolver
that resolves DBRef
s by delegating to a
DbRefResolverCallback
than is able to generate lazy loading proxies.Constructor and Description |
---|
DefaultDbRefResolver(MongoDbFactory mongoDbFactory)
Creates a new
DefaultDbRefResolver with the given MongoDbFactory . |
Modifier and Type | Method and Description |
---|---|
com.mongodb.DBRef |
createDbRef(DBRef annotation,
MongoPersistentEntity<?> entity,
Object id)
|
com.mongodb.DBObject |
fetch(com.mongodb.DBRef dbRef)
Actually loads the
DBRef from the datasource. |
Object |
resolveDbRef(MongoPersistentProperty property,
com.mongodb.DBRef dbref,
DbRefResolverCallback callback,
DbRefProxyHandler handler)
Resolves the given
DBRef into an object of the given MongoPersistentProperty 's type. |
public DefaultDbRefResolver(MongoDbFactory mongoDbFactory)
DefaultDbRefResolver
with the given MongoDbFactory
.mongoDbFactory
- must not be null.public Object resolveDbRef(MongoPersistentProperty property, com.mongodb.DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler handler)
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.public com.mongodb.DBRef createDbRef(DBRef annotation, MongoPersistentEntity<?> entity, Object id)
DbRefResolver
createDbRef
in interface DbRefResolver
annotation
- will never be null.entity
- will never be null.id
- will never be null.public com.mongodb.DBObject fetch(com.mongodb.DBRef dbRef)
DbRefResolver
DBRef
from the datasource.fetch
in interface DbRefResolver
dbRef
- must not be null.Copyright © 2011-2015–2015 Pivotal Software, Inc.. All rights reserved.