Spring Data MongoDB - Core

org.springframework.data.mongodb.core.convert
Class DefaultDbRefResolver

java.lang.Object
  extended by org.springframework.data.mongodb.core.convert.DefaultDbRefResolver
All Implemented Interfaces:
DbRefResolver

public class DefaultDbRefResolver
extends Object
implements DbRefResolver

A DbRefResolver that resolves DBRefs by delegating to a DbRefResolverCallback than is able to generate lazy loading proxies.

Author:
Thomas Darimont, Oliver Gierke

Constructor Summary
DefaultDbRefResolver(MongoDbFactory mongoDbFactory)
          Creates a new DefaultDbRefResolver with the given MongoDbFactory.
 
Method Summary
 com.mongodb.DBRef createDbRef(DBRef annotation, MongoPersistentEntity<?> entity, Object id)
          Creates a DBRef instance for the given DBRef annotation, MongoPersistentEntity and id.
 Object resolveDbRef(MongoPersistentProperty property, DbRefResolverCallback callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDbRefResolver

public DefaultDbRefResolver(MongoDbFactory mongoDbFactory)
Creates a new DefaultDbRefResolver with the given MongoDbFactory.

Parameters:
mongoDbFactory - must not be null.
Method Detail

resolveDbRef

public Object resolveDbRef(MongoPersistentProperty property,
                           DbRefResolverCallback callback)
Specified by:
resolveDbRef in interface DbRefResolver
Parameters:
property - will never be null.
callback - will never be null.
Returns:

createDbRef

public com.mongodb.DBRef createDbRef(DBRef annotation,
                                     MongoPersistentEntity<?> entity,
                                     Object id)
Description copied from interface: DbRefResolver
Creates a DBRef instance for the given DBRef annotation, MongoPersistentEntity and id.

Specified by:
createDbRef in interface DbRefResolver
Parameters:
annotation - will never be null.
entity - will never be null.
id - will never be null.
Returns:

Spring Data MongoDB - Core

Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.