Package com.mongodb
Class DBRef
- java.lang.Object
-
- com.mongodb.DBRef
-
- All Implemented Interfaces:
Serializable
public class DBRef extends Object implements Serializable
A representation of a database reference.- See Also:
- Serialized Form
- MongoDB documentation
- Database References
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getCollectionName()
Gets the name of the collection in which the referenced document is stored.String
getDatabaseName()
Gets the name of the database in which the referenced document is stored.Object
getId()
Gets the _id of the referenced documentint
hashCode()
String
toString()
-
-
-
Method Detail
-
getId
public Object getId()
Gets the _id of the referenced document- Returns:
- the _id of the referenced document
-
getCollectionName
public String getCollectionName()
Gets the name of the collection in which the referenced document is stored.- Returns:
- the name of the collection in which the referenced is stored
-
getDatabaseName
@Nullable public String getDatabaseName()
Gets the name of the database in which the referenced document is stored. A null value implies that the referenced document is stored in the same database as the referring document.- Returns:
- the possibly-null database name
- Since:
- 3.3
-
-