public class DBRefBase extends Object implements Serializable
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()
For use only with serialization framework.
|
|
DBRefBase(DB db,
String ns,
Object id)
Creates a DBRefBase
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
DBObject |
fetch()
fetches the object referenced from the database
|
DB |
getDB()
Gets the database, which may be null, in which case the reference can not be fetched.
|
Object |
getId()
Gets the object's id
|
String |
getRef()
Gets the object's namespace (collection name)
|
int |
hashCode() |
String |
toString() |
public DBRefBase(DB db, String ns, Object id)
db
- the databasens
- the namespace where the object is storedid
- the object idprotected DBRefBase()
public DBObject fetch() throws MongoException
MongoException
public Object getId()
public String getRef()
public DB getDB()
fetch()