DBRef
class exclusively@Deprecated
public class DBRefBase
extends java.lang.Object
implements java.io.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,
java.lang.String ns,
java.lang.Object id)
Deprecated.
Deprecated because
fetch() is deprecated. Use DBRefBase(String, Object) instead |
|
DBRefBase(java.lang.String ns,
java.lang.Object id)
Deprecated.
Creates a DBRefBase
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Deprecated.
|
DBObject |
fetch()
Deprecated.
use
DBCollection.findOne(Object) instead |
java.lang.String |
getCollectionName()
Deprecated.
Gets the name of the collection in which the referenced document is stored.
|
DB |
getDB()
Deprecated.
deprecated because
fetch() is deprecated |
java.lang.Object |
getId()
Deprecated.
Gets the _id of the referenced document
|
java.lang.String |
getRef()
Deprecated.
use
getCollectionName() instead |
int |
hashCode()
Deprecated.
|
java.lang.String |
toString()
Deprecated.
|
public DBRefBase(java.lang.String ns, java.lang.Object id)
ns
- the namespace where the object is storedid
- the object id@Deprecated public DBRefBase(DB db, java.lang.String ns, java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getId()
public java.lang.String getCollectionName()
@Deprecated public java.lang.String getRef()
getCollectionName()
instead@Deprecated public DB getDB()
fetch()
is deprecatedfetch()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object