DBRef
class exclusively@Deprecated public class DBRefBase extends Object implements Serializable
Represents a database reference, which points to an object stored in the database.
While instances of this class are Serializable
, deserialized instances can not be fetched, as the db
property is
transient.
Modifier | Constructor and Description |
---|---|
protected |
DBRefBase()
Deprecated.
For use only with serialization framework.
|
|
DBRefBase(DB db,
String ns,
Object id)
Deprecated.
Deprecated because
fetch() is deprecated. Use DBRefBase(String, Object) instead |
|
DBRefBase(String ns,
Object id)
Deprecated.
Creates a DBRefBase
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Deprecated.
|
DBObject |
fetch()
Deprecated.
use
DBCollection.findOne(Object) instead |
String |
getCollectionName()
Deprecated.
Gets the name of the collection in which the referenced document is stored.
|
DB |
getDB()
Deprecated.
deprecated because
fetch() is deprecated |
Object |
getId()
Deprecated.
Gets the _id of the referenced document
|
String |
getRef()
Deprecated.
use
getCollectionName() instead |
int |
hashCode()
Deprecated.
|
String |
toString()
Deprecated.
|
public DBRefBase(String ns, Object id)
ns
- the namespace where the object is storedid
- the object id@Deprecated public DBRefBase(DB db, String ns, Object id)
db
- the databasens
- the namespace where the object is storedid
- the object idprotected DBRefBase()
@Deprecated public DBObject fetch() throws MongoException
DBCollection.findOne(Object)
insteadMongoException
public Object getId()
public String getCollectionName()
@Deprecated public String getRef()
getCollectionName()
instead@Deprecated public DB getDB()
fetch()
is deprecatedfetch()