@@ -303,11 +303,18 @@ public Mongo(
303
303
}
304
304
305
305
/**
306
- * Sets the write concern for this database. Will be used as default for writes to any collection in any database. See the documentation
307
- * for {@link WriteConcern} for more information.
306
+ * Sets the default write concern to use for write operations executed on any {@link DBCollection} created indirectly from this
307
+ * instance, via a {@link DB} instance created from {@link #getDB(String)}.
308
+ *
309
+ * <p>
310
+ * Note that changes to the default write concern made via this method will NOT affect the write concern of
311
+ * {@link com.mongodb.client.MongoDatabase} instances created via {@link MongoClient#getDatabase(String)}
312
+ * </p>
308
313
*
309
314
* @param writeConcern write concern to use
315
+ * @deprecated Set the default write concern with either {@link MongoClientURI} or {@link MongoClientOptions}
310
316
*/
317
+ @ Deprecated
311
318
public void setWriteConcern (final WriteConcern writeConcern ) {
312
319
this .writeConcern = writeConcern ;
313
320
}
@@ -331,11 +338,18 @@ public ReadConcern getReadConcern() {
331
338
}
332
339
333
340
/**
334
- * Sets the read preference for this database. Will be used as default for reads from any collection in any database. See the
335
- * documentation for {@link ReadPreference} for more information .
341
+ * Sets the default read preference to use for reads operations executed on any {@link DBCollection} created indirectly from this
342
+ * instance, via a {@link DB} instance created from {@link #getDB(String)} .
336
343
*
344
+ * <p>
345
+ * Note that changes to the default read preference made via this method will NOT affect the read preference of
346
+ * {@link com.mongodb.client.MongoDatabase} instances created via {@link MongoClient#getDatabase(String)}
347
+ * </p>
348
+
337
349
* @param readPreference Read Preference to use
350
+ * @deprecated Set the default read preference with either {@link MongoClientURI} or {@link MongoClientOptions}
338
351
*/
352
+ @ Deprecated
339
353
public void setReadPreference (final ReadPreference readPreference ) {
340
354
this .readPreference = readPreference ;
341
355
}
@@ -509,35 +523,58 @@ public void slaveOk() {
509
523
}
510
524
511
525
/**
512
- * Set the default query options.
526
+ * Set the default query options for reads operations executed on any {@link DBCollection} created indirectly from this
527
+ * instance, via a {@link DB} instance created from {@link #getDB(String)}.
528
+ *
529
+ * <p>
530
+ * Note that changes to query options made via this method will NOT affect
531
+ * {@link com.mongodb.client.MongoDatabase} instances created via {@link MongoClient#getDatabase(String)}
532
+ * </p>
513
533
*
514
534
* @param options value to be set
535
+ * @deprecated Set options on instances of {@link DBCursor}
515
536
*/
537
+ @ Deprecated
516
538
public void setOptions (final int options ) {
517
539
optionHolder .set (options );
518
540
}
519
541
520
542
/**
521
- * Reset the default query options.
543
+ * Reset the default query options for reads operations executed on any {@link DBCollection} created indirectly from this
544
+ * instance, via a {@link DB} instance created from {@link #getDB(String)}.
545
+ *
546
+ * @deprecated Reset options instead on instances of {@link DBCursor}
522
547
*/
548
+ @ Deprecated
523
549
public void resetOptions () {
524
550
optionHolder .reset ();
525
551
}
526
552
527
553
/**
528
- * Add the default query option.
554
+ * Add the default query option for reads operations executed on any {@link DBCollection} created indirectly from this
555
+ * instance, via a {@link DB} instance created from {@link #getDB(String)}.
556
+ *
557
+ * <p>
558
+ * Note that changes to query options made via this method will NOT affect
559
+ * {@link com.mongodb.client.MongoDatabase} instances created via {@link MongoClient#getDatabase(String)}
560
+ * </p>
529
561
*
530
562
* @param option value to be added to current options
563
+ * @deprecated Add options instead on instances of {@link DBCursor}
531
564
*/
565
+ @ Deprecated
532
566
public void addOption (final int option ) {
533
567
optionHolder .add (option );
534
568
}
535
569
536
570
/**
537
- * Gets the default query options
571
+ * Gets the default query options for reads operations executed on any {@link DBCollection} created indirectly from this
572
+ * instance, via a {@link DB} instance created from {@link #getDB(String)}.
538
573
*
539
574
* @return an int representing the options to be used by queries
575
+ * @deprecated Get options instead from instances of {@link DBCursor}
540
576
*/
577
+ @ Deprecated
541
578
public int getOptions () {
542
579
return optionHolder .get ();
543
580
}
0 commit comments