@@ -308,6 +308,7 @@ public void setReadPreference(@Nullable ReadPreference readPreference) {
308
308
this .readPreference = readPreference ;
309
309
}
310
310
311
+ @ Override
311
312
public void setApplicationContext (ApplicationContext applicationContext ) throws BeansException {
312
313
313
314
prepareIndexCreator (applicationContext );
@@ -411,6 +412,7 @@ private void prepareIndexCreator(ApplicationContext context) {
411
412
*
412
413
* @return
413
414
*/
415
+ @ Override
414
416
public MongoConverter getConverter () {
415
417
return this .mongoConverter ;
416
418
}
@@ -521,6 +523,7 @@ protected void executeQuery(Query query, String collectionName, DocumentCallback
521
523
preparer != null ? preparer : CursorPreparer .NO_OP_PREPARER , documentCallbackHandler , collectionName );
522
524
}
523
525
526
+ @ Override
524
527
public <T > T execute (DbCallback <T > action ) {
525
528
526
529
Assert .notNull (action , "DbCallback must not be null!" );
@@ -533,12 +536,14 @@ public <T> T execute(DbCallback<T> action) {
533
536
}
534
537
}
535
538
539
+ @ Override
536
540
public <T > T execute (Class <?> entityClass , CollectionCallback <T > callback ) {
537
541
538
542
Assert .notNull (entityClass , "EntityClass must not be null!" );
539
543
return execute (getCollectionName (entityClass ), callback );
540
544
}
541
545
546
+ @ Override
542
547
public <T > T execute (String collectionName , CollectionCallback <T > callback ) {
543
548
544
549
Assert .notNull (collectionName , "CollectionName must not be null!" );
@@ -579,10 +584,12 @@ public void setSessionSynchronization(SessionSynchronization sessionSynchronizat
579
584
this .sessionSynchronization = sessionSynchronization ;
580
585
}
581
586
587
+ @ Override
582
588
public <T > MongoCollection <Document > createCollection (Class <T > entityClass ) {
583
589
return createCollection (entityClass , operations .forType (entityClass ).getCollectionOptions ());
584
590
}
585
591
592
+ @ Override
586
593
public <T > MongoCollection <Document > createCollection (Class <T > entityClass ,
587
594
@ Nullable CollectionOptions collectionOptions ) {
588
595
@@ -597,20 +604,23 @@ public <T> MongoCollection<Document> createCollection(Class<T> entityClass,
597
604
return doCreateCollection (getCollectionName (entityClass ), convertToDocument (options , entityClass ));
598
605
}
599
606
607
+ @ Override
600
608
public MongoCollection <Document > createCollection (String collectionName ) {
601
609
602
610
Assert .notNull (collectionName , "CollectionName must not be null!" );
603
611
604
612
return doCreateCollection (collectionName , new Document ());
605
613
}
606
614
615
+ @ Override
607
616
public MongoCollection <Document > createCollection (String collectionName ,
608
617
@ Nullable CollectionOptions collectionOptions ) {
609
618
610
619
Assert .notNull (collectionName , "CollectionName must not be null!" );
611
620
return doCreateCollection (collectionName , convertToDocument (collectionOptions , Object .class ));
612
621
}
613
622
623
+ @ Override
614
624
@ SuppressWarnings ("ConstantConditions" )
615
625
public MongoCollection <Document > getCollection (String collectionName ) {
616
626
@@ -619,10 +629,12 @@ public MongoCollection<Document> getCollection(String collectionName) {
619
629
return execute (db -> db .getCollection (collectionName , Document .class ));
620
630
}
621
631
632
+ @ Override
622
633
public <T > boolean collectionExists (Class <T > entityClass ) {
623
634
return collectionExists (getCollectionName (entityClass ));
624
635
}
625
636
637
+ @ Override
626
638
@ SuppressWarnings ("ConstantConditions" )
627
639
public boolean collectionExists (String collectionName ) {
628
640
@@ -639,10 +651,12 @@ public boolean collectionExists(String collectionName) {
639
651
});
640
652
}
641
653
654
+ @ Override
642
655
public <T > void dropCollection (Class <T > entityClass ) {
643
656
dropCollection (getCollectionName (entityClass ));
644
657
}
645
658
659
+ @ Override
646
660
public void dropCollection (String collectionName ) {
647
661
648
662
Assert .notNull (collectionName , "CollectionName must not be null!" );
@@ -662,22 +676,27 @@ public IndexOperations indexOps(String collectionName) {
662
676
return indexOps (collectionName , null );
663
677
}
664
678
679
+ @ Override
665
680
public IndexOperations indexOps (String collectionName , @ Nullable Class <?> type ) {
666
681
return new DefaultIndexOperations (this , collectionName , type );
667
682
}
668
683
684
+ @ Override
669
685
public IndexOperations indexOps (Class <?> entityClass ) {
670
686
return indexOps (getCollectionName (entityClass ), entityClass );
671
687
}
672
688
689
+ @ Override
673
690
public BulkOperations bulkOps (BulkMode bulkMode , String collectionName ) {
674
691
return bulkOps (bulkMode , null , collectionName );
675
692
}
676
693
694
+ @ Override
677
695
public BulkOperations bulkOps (BulkMode bulkMode , Class <?> entityClass ) {
678
696
return bulkOps (bulkMode , entityClass , getCollectionName (entityClass ));
679
697
}
680
698
699
+ @ Override
681
700
public BulkOperations bulkOps (BulkMode mode , @ Nullable Class <?> entityType , String collectionName ) {
682
701
683
702
Assert .notNull (mode , "BulkMode must not be null!" );
@@ -1017,6 +1036,7 @@ public long count(Query query, String collectionName) {
1017
1036
* (non-Javadoc)
1018
1037
* @see org.springframework.data.mongodb.core.MongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
1019
1038
*/
1039
+ @ Override
1020
1040
public long count (Query query , @ Nullable Class <?> entityClass , String collectionName ) {
1021
1041
1022
1042
Assert .notNull (query , "Query must not be null!" );
@@ -2127,6 +2147,7 @@ protected String replaceWithResourceIfNecessary(String function) {
2127
2147
return func ;
2128
2148
}
2129
2149
2150
+ @ Override
2130
2151
@ SuppressWarnings ("ConstantConditions" )
2131
2152
public Set <String > getCollectionNames () {
2132
2153
return execute (db -> {
@@ -2782,6 +2803,7 @@ public FindCallback(Document query, Document fields, @Nullable com.mongodb.clien
2782
2803
this .collation = collation ;
2783
2804
}
2784
2805
2806
+ @ Override
2785
2807
public FindIterable <Document > doInCollection (MongoCollection <Document > collection )
2786
2808
throws MongoException , DataAccessException {
2787
2809
@@ -2841,6 +2863,7 @@ private static class FindAndRemoveCallback implements CollectionCallback<Documen
2841
2863
this .collation = Optional .ofNullable (collation );
2842
2864
}
2843
2865
2866
+ @ Override
2844
2867
public Document doInCollection (MongoCollection <Document > collection ) throws MongoException , DataAccessException {
2845
2868
2846
2869
FindOneAndDeleteOptions opts = new FindOneAndDeleteOptions ().sort (sort ).projection (fields );
@@ -2870,6 +2893,7 @@ private static class FindAndModifyCallback implements CollectionCallback<Documen
2870
2893
this .options = options ;
2871
2894
}
2872
2895
2896
+ @ Override
2873
2897
public Document doInCollection (MongoCollection <Document > collection ) throws MongoException , DataAccessException {
2874
2898
2875
2899
FindOneAndUpdateOptions opts = new FindOneAndUpdateOptions ();
@@ -2978,6 +3002,7 @@ private class ReadDocumentCallback<T> implements DocumentCallback<T> {
2978
3002
this .collectionName = collectionName ;
2979
3003
}
2980
3004
3005
+ @ Override
2981
3006
public T doWith (Document document ) {
2982
3007
2983
3008
maybeEmitEvent (new AfterLoadEvent <>(document , type , collectionName ));
@@ -3015,6 +3040,7 @@ private class ProjectingReadCallback<S, T> implements DocumentCallback<T> {
3015
3040
this .collectionName = collectionName ;
3016
3041
}
3017
3042
3043
+ @ Override
3018
3044
@ SuppressWarnings ("unchecked" )
3019
3045
public T doWith (Document document ) {
3020
3046
@@ -3046,6 +3072,7 @@ class QueryCursorPreparer implements CursorPreparer {
3046
3072
this .type = type ;
3047
3073
}
3048
3074
3075
+ @ Override
3049
3076
public FindIterable <Document > prepare (FindIterable <Document > iterable ) {
3050
3077
3051
3078
FindIterable <Document > cursorToUse = iterable ;
@@ -3163,6 +3190,7 @@ static class GeoNearResultDocumentCallback<T> implements DocumentCallback<GeoRes
3163
3190
this .metric = metric ;
3164
3191
}
3165
3192
3193
+ @ Override
3166
3194
public GeoResult <T > doWith (Document object ) {
3167
3195
3168
3196
double distance = Double .NaN ;
0 commit comments