Class DBRef<T,K>
java.lang.Object
org.mongojack.DBRef<T,K>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the collection this object lives ingetId()Get the ID of this object
-
Constructor Details
-
DBRef
Construct a new database reference with the given id and collection name- Parameters:
id- The id of the database reference to constructobjectClass- The value class of the collection that the ref is pointing tocollectionName- The name of the collectiondatabaseName- The database name holding the collection (optional)
-
DBRef
Construct a new database reference with the given id and type. The type must be annotated withMongoCollection, so that the name can be worked out.- Parameters:
id- The id of the database reference to constructtype- The type of the object- Throws:
MongoDatabindException- If no MongoCollection annotation is found on the type
-
-
Method Details
-
getId
-
getObjectClass
-
getCollectionName
Get the name of the collection this object lives in- Returns:
- The name of the collection this object lives in
-
getDatabaseName
-
getCollectionKey
-