com.mongodb
Class DBRefBase

java.lang.Object
  extended by com.mongodb.DBRefBase
Direct Known Subclasses:
DBPointer, DBRef

public class DBRefBase
extends Object

represents a database reference, which points to an object stored in the database


Constructor Summary
DBRefBase(DB db, String ns, Object id)
          Creates a DBRefBase
 
Method Summary
 boolean equals(Object o)
           
 DBObject fetch()
          fetches the object referenced from the database
 DB getDB()
          Gets the database
 Object getId()
          Gets the object's id
 String getRef()
          Gets the object's namespace (collection name)
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBRefBase

public DBRefBase(DB db,
                 String ns,
                 Object id)
Creates a DBRefBase

Parameters:
db - the database
ns - the namespace where the object is stored
id - the object id
Method Detail

fetch

public DBObject fetch()
               throws MongoException
fetches the object referenced from the database

Returns:
Throws:
MongoException

toString

public String toString()
Overrides:
toString in class Object

getId

public Object getId()
Gets the object's id

Returns:

getRef

public String getRef()
Gets the object's namespace (collection name)

Returns:

getDB

public DB getDB()
Gets the database

Returns:

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object