net.vz.mongodb.jackson.internal
Class FetchableDBRef<T,K>

java.lang.Object
  extended by net.vz.mongodb.jackson.DBRef<T,K>
      extended by net.vz.mongodb.jackson.internal.FetchableDBRef<T,K>

public class FetchableDBRef<T,K>
extends DBRef<T,K>

DBRef that can be fetched

Since:
1.2
Author:
James Roper

Constructor Summary
FetchableDBRef(K id, JacksonDBCollection<T,K> dbCollection)
           
 
Method Summary
 T fetch()
          Fetch the object.
 T fetch(com.mongodb.DBObject fields)
          Fetch only the given fields of the object.
 JacksonCollectionKey getCollectionKey()
           
 
Methods inherited from class net.vz.mongodb.jackson.DBRef
getCollectionName, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchableDBRef

public FetchableDBRef(K id,
                      JacksonDBCollection<T,K> dbCollection)
Method Detail

fetch

public T fetch()
Description copied from class: DBRef
Fetch the object. Should only be called for references that have been returned by the mapper, will return null otherwise.

Deserialisation is done by the ObjectMapper that fetched the object that this reference belongs to.

Overrides:
fetch in class DBRef<T,K>
Returns:
If this DBRef was returned by the mapper, the referenced object, if it exists, or null

fetch

public T fetch(com.mongodb.DBObject fields)
Description copied from class: DBRef
Fetch only the given fields of the object. Should only be called for references that have been returned by the mapper, will return null otherwise.

Deserialisation is done by the ObjectMapper that fetched the object that this reference belongs to.

Unlike the fetch() method, calls to this are not cached.

Overrides:
fetch in class DBRef<T,K>
Parameters:
fields - The fields to fetch
Returns:
If this DBRef was returned by the mapper, the referenced object, if it exists, or null

getCollectionKey

public JacksonCollectionKey getCollectionKey()


Copyright © 2011-2012 VZ Netzwerke. All Rights Reserved.