public class DBRef extends DBRefBase
Extends DBRefBase to understand a BSONObject representation of a reference.
While instances of this class are Serializable
, deserialized instances can not be fetched, as the db
property is
transient.
Constructor and Description |
---|
DBRef(DB db,
BSONObject o)
Deprecated.
Deprecated because
DBRefBase.fetch() is deprecated. Use DBRef(String, Object) instead |
DBRef(DB db,
String ns,
Object id)
Deprecated.
Deprecated because
DBRefBase.fetch() is deprecated. Use DBRef(String, Object) instead |
DBRef(String ns,
Object id)
Creates a DBRef.
|
Modifier and Type | Method and Description |
---|---|
static DBObject |
fetch(DB db,
DBObject ref)
Deprecated.
use
DBCollection.findOne(Object) instead |
public DBRef(String ns, Object id)
ns
- the namespace where the object is storedid
- the object id@Deprecated public DBRef(DB db, BSONObject o)
DBRefBase.fetch()
is deprecated. Use DBRef(String, Object)
insteaddb
- the databaseo
- a BSON object representing the reference@Deprecated public DBRef(DB db, String ns, Object id)
DBRefBase.fetch()
is deprecated. Use DBRef(String, Object)
insteaddb
- the databasens
- the namespace where the object is storedid
- the object id@Deprecated public static DBObject fetch(DB db, DBObject ref)
DBCollection.findOne(Object)
insteaddb
- the databaseref
- the referenceMongoException