[JAVA-1505] Deprecate DBRef.fetch and DBRefBase Created: 17/Oct/14  Updated: 29/Jan/15  Resolved: 17/Oct/14

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 2.13.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by JAVA-1506 Remove DBRefBase and DBRef.fetch Closed
Epic Link: 2.13 Deprecations

 Description   

The fact that DBRef needs to be constructed with a DB instance so that the reference can be fetched means that the class can only be used in a context where a DB is available. This is not going to be the case when using the new CRUD API. In addition, the fetch method is limited in that you can't specify, for example, a read preference when fetching. Since fetch is easily implemented in client code by getting the collection name and id from the DBRef and calling findOne, this method will be deprecated.

Also, DBRefBase will be deprecated since DBRef is the only non-deprecated subclass.



 Comments   
Comment by Jeffrey Yemin [ 29/Jan/15 ]

2.13.0 has been released. Closing issue.

Comment by Githook User [ 17/Oct/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Deprecated all methods and constructs in DBRef and DBRefBase that depend on the DB class. Also deprecated DBRefBase.

JAVA-1505
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/5d55246c9d5ea53033f3fba817fd6173ec734637

Generated at Thu Feb 08 08:54:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.