com.mongodb
Class DBRef
java.lang.Object
com.mongodb.DBRefBase
com.mongodb.DBRef
public class DBRef
- extends DBRefBase
overrides DBRefBase to understand a BSONObject representation of a reference.
- MongoDB Doc Links
Constructor Summary |
DBRef(DB db,
BSONObject o)
Creates a DBRef |
DBRef(DB db,
java.lang.String ns,
java.lang.Object id)
Creates a DBRef |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DBRef
public DBRef(DB db,
BSONObject o)
- Creates a DBRef
- Parameters:
db
- the databaseo
- a BSON object representing the reference
DBRef
public DBRef(DB db,
java.lang.String ns,
java.lang.Object id)
- Creates a DBRef
- Parameters:
db
- the databasens
- the namespace where the object is storedid
- the object id
fetch
public static DBObject fetch(DB db,
DBObject ref)
- fetches a referenced object from the database
- Parameters:
db
- the databaseref
- the reference
- Returns: