@@ -315,6 +315,7 @@ public void setReadPreference(@Nullable ReadPreference readPreference) {
315
315
* (non-Javadoc)
316
316
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
317
317
*/
318
+ @ Override
318
319
public void setApplicationContext (ApplicationContext applicationContext ) throws BeansException {
319
320
320
321
prepareIndexCreator (applicationContext );
@@ -380,6 +381,7 @@ private void prepareIndexCreator(ApplicationContext context) {
380
381
*
381
382
* @return
382
383
*/
384
+ @ Override
383
385
public MongoConverter getConverter () {
384
386
return this .mongoConverter ;
385
387
}
@@ -519,6 +521,7 @@ protected void executeQuery(Query query, String collectionName, DocumentCallback
519
521
* (non-Javadoc)
520
522
* @see org.springframework.data.mongodb.core.MongoOperations#execute(org.springframework.data.mongodb.core.DbCallback)
521
523
*/
524
+ @ Override
522
525
public <T > T execute (DbCallback <T > action ) {
523
526
524
527
Assert .notNull (action , "DbCallback must not be null!" );
@@ -535,6 +538,7 @@ public <T> T execute(DbCallback<T> action) {
535
538
* (non-Javadoc)
536
539
* @see org.springframework.data.mongodb.core.MongoOperations#execute(java.lang.Class, org.springframework.data.mongodb.core.DbCallback)
537
540
*/
541
+ @ Override
538
542
public <T > T execute (Class <?> entityClass , CollectionCallback <T > callback ) {
539
543
540
544
Assert .notNull (entityClass , "EntityClass must not be null!" );
@@ -545,6 +549,7 @@ public <T> T execute(Class<?> entityClass, CollectionCallback<T> callback) {
545
549
* (non-Javadoc)
546
550
* @see org.springframework.data.mongodb.core.MongoOperations#execute(java.lang.String, org.springframework.data.mongodb.core.DbCallback)
547
551
*/
552
+ @ Override
548
553
public <T > T execute (String collectionName , CollectionCallback <T > callback ) {
549
554
550
555
Assert .notNull (collectionName , "CollectionName must not be null!" );
@@ -597,6 +602,7 @@ public void setSessionSynchronization(SessionSynchronization sessionSynchronizat
597
602
* (non-Javadoc)
598
603
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.Class)
599
604
*/
605
+ @ Override
600
606
public <T > MongoCollection <Document > createCollection (Class <T > entityClass ) {
601
607
return createCollection (entityClass , operations .forType (entityClass ).getCollectionOptions ());
602
608
}
@@ -605,6 +611,7 @@ public <T> MongoCollection<Document> createCollection(Class<T> entityClass) {
605
611
* (non-Javadoc)
606
612
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.Class, org.springframework.data.mongodb.core.CollectionOptions)
607
613
*/
614
+ @ Override
608
615
public <T > MongoCollection <Document > createCollection (Class <T > entityClass ,
609
616
@ Nullable CollectionOptions collectionOptions ) {
610
617
@@ -623,6 +630,7 @@ public <T> MongoCollection<Document> createCollection(Class<T> entityClass,
623
630
* (non-Javadoc)
624
631
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.String)
625
632
*/
633
+ @ Override
626
634
public MongoCollection <Document > createCollection (String collectionName ) {
627
635
628
636
Assert .notNull (collectionName , "CollectionName must not be null!" );
@@ -634,6 +642,7 @@ public MongoCollection<Document> createCollection(String collectionName) {
634
642
* (non-Javadoc)
635
643
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.String, org.springframework.data.mongodb.core.CollectionOptions)
636
644
*/
645
+ @ Override
637
646
public MongoCollection <Document > createCollection (String collectionName ,
638
647
@ Nullable CollectionOptions collectionOptions ) {
639
648
@@ -645,6 +654,7 @@ public MongoCollection<Document> createCollection(String collectionName,
645
654
* (non-Javadoc)
646
655
* @see org.springframework.data.mongodb.core.MongoOperations#getCollection(java.lang.String)
647
656
*/
657
+ @ Override
648
658
@ SuppressWarnings ("ConstantConditions" )
649
659
public MongoCollection <Document > getCollection (String collectionName ) {
650
660
@@ -657,6 +667,7 @@ public MongoCollection<Document> getCollection(String collectionName) {
657
667
* (non-Javadoc)
658
668
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollection(java.lang.Class)
659
669
*/
670
+ @ Override
660
671
public <T > boolean collectionExists (Class <T > entityClass ) {
661
672
return collectionExists (getCollectionName (entityClass ));
662
673
}
@@ -665,6 +676,7 @@ public <T> boolean collectionExists(Class<T> entityClass) {
665
676
* (non-Javadoc)
666
677
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollection(java.lang.String)
667
678
*/
679
+ @ Override
668
680
@ SuppressWarnings ("ConstantConditions" )
669
681
public boolean collectionExists (String collectionName ) {
670
682
@@ -685,6 +697,7 @@ public boolean collectionExists(String collectionName) {
685
697
* (non-Javadoc)
686
698
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#dropCollection(java.lang.Class)
687
699
*/
700
+ @ Override
688
701
public <T > void dropCollection (Class <T > entityClass ) {
689
702
dropCollection (getCollectionName (entityClass ));
690
703
}
@@ -693,6 +706,7 @@ public <T> void dropCollection(Class<T> entityClass) {
693
706
* (non-Javadoc)
694
707
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#dropCollection(java.lang.String)
695
708
*/
709
+ @ Override
696
710
public void dropCollection (String collectionName ) {
697
711
698
712
Assert .notNull (collectionName , "CollectionName must not be null!" );
@@ -716,6 +730,7 @@ public IndexOperations indexOps(String collectionName) {
716
730
* (non-Javadoc)
717
731
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#indexOps(java.lang.String)
718
732
*/
733
+ @ Override
719
734
public IndexOperations indexOps (String collectionName , @ Nullable Class <?> type ) {
720
735
return new DefaultIndexOperations (this , collectionName , type );
721
736
}
@@ -724,6 +739,7 @@ public IndexOperations indexOps(String collectionName, @Nullable Class<?> type)
724
739
* (non-Javadoc)
725
740
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#indexOps(java.lang.Class)
726
741
*/
742
+ @ Override
727
743
public IndexOperations indexOps (Class <?> entityClass ) {
728
744
return indexOps (getCollectionName (entityClass ), entityClass );
729
745
}
@@ -732,6 +748,7 @@ public IndexOperations indexOps(Class<?> entityClass) {
732
748
* (non-Javadoc)
733
749
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.String)
734
750
*/
751
+ @ Override
735
752
public BulkOperations bulkOps (BulkMode bulkMode , String collectionName ) {
736
753
return bulkOps (bulkMode , null , collectionName );
737
754
}
@@ -740,6 +757,7 @@ public BulkOperations bulkOps(BulkMode bulkMode, String collectionName) {
740
757
* (non-Javadoc)
741
758
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.Class)
742
759
*/
760
+ @ Override
743
761
public BulkOperations bulkOps (BulkMode bulkMode , Class <?> entityClass ) {
744
762
return bulkOps (bulkMode , entityClass , getCollectionName (entityClass ));
745
763
}
@@ -748,6 +766,7 @@ public BulkOperations bulkOps(BulkMode bulkMode, Class<?> entityClass) {
748
766
* (non-Javadoc)
749
767
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.Class, java.lang.String)
750
768
*/
769
+ @ Override
751
770
public BulkOperations bulkOps (BulkMode mode , @ Nullable Class <?> entityType , String collectionName ) {
752
771
753
772
Assert .notNull (mode , "BulkMode must not be null!" );
@@ -1109,6 +1128,7 @@ public long count(Query query, String collectionName) {
1109
1128
* (non-Javadoc)
1110
1129
* @see org.springframework.data.mongodb.core.MongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
1111
1130
*/
1131
+ @ Override
1112
1132
public long count (Query query , @ Nullable Class <?> entityClass , String collectionName ) {
1113
1133
1114
1134
Assert .notNull (query , "Query must not be null!" );
@@ -1915,10 +1935,12 @@ public <T> List<T> mapReduce(Query query, Class<?> domainType, String inputColle
1915
1935
return mappedResults ;
1916
1936
}
1917
1937
1938
+ @ Override
1918
1939
public <T > GroupByResults <T > group (String inputCollectionName , GroupBy groupBy , Class <T > entityClass ) {
1919
1940
return group (null , inputCollectionName , groupBy , entityClass );
1920
1941
}
1921
1942
1943
+ @ Override
1922
1944
public <T > GroupByResults <T > group (@ Nullable Criteria criteria , String inputCollectionName , GroupBy groupBy ,
1923
1945
Class <T > entityClass ) {
1924
1946
@@ -2325,6 +2347,7 @@ protected String replaceWithResourceIfNecessary(String function) {
2325
2347
* (non-Javadoc)
2326
2348
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollectionNames()
2327
2349
*/
2350
+ @ Override
2328
2351
@ SuppressWarnings ("ConstantConditions" )
2329
2352
public Set <String > getCollectionNames () {
2330
2353
return execute (db -> {
@@ -2974,6 +2997,7 @@ public FindCallback(Document query, Document fields, @Nullable com.mongodb.clien
2974
2997
this .collation = collation ;
2975
2998
}
2976
2999
3000
+ @ Override
2977
3001
public FindIterable <Document > doInCollection (MongoCollection <Document > collection )
2978
3002
throws MongoException , DataAccessException {
2979
3003
@@ -3033,6 +3057,7 @@ private static class FindAndRemoveCallback implements CollectionCallback<Documen
3033
3057
this .collation = Optional .ofNullable (collation );
3034
3058
}
3035
3059
3060
+ @ Override
3036
3061
public Document doInCollection (MongoCollection <Document > collection ) throws MongoException , DataAccessException {
3037
3062
3038
3063
FindOneAndDeleteOptions opts = new FindOneAndDeleteOptions ().sort (sort ).projection (fields );
@@ -3062,6 +3087,7 @@ private static class FindAndModifyCallback implements CollectionCallback<Documen
3062
3087
this .options = options ;
3063
3088
}
3064
3089
3090
+ @ Override
3065
3091
public Document doInCollection (MongoCollection <Document > collection ) throws MongoException , DataAccessException {
3066
3092
3067
3093
FindOneAndUpdateOptions opts = new FindOneAndUpdateOptions ();
@@ -3174,6 +3200,7 @@ private class ReadDocumentCallback<T> implements DocumentCallback<T> {
3174
3200
this .collectionName = collectionName ;
3175
3201
}
3176
3202
3203
+ @ Override
3177
3204
public T doWith (Document document ) {
3178
3205
3179
3206
maybeEmitEvent (new AfterLoadEvent <>(document , type , collectionName ));
@@ -3218,6 +3245,7 @@ private class ProjectingReadCallback<S, T> implements DocumentCallback<T> {
3218
3245
* (non-Javadoc)
3219
3246
* @see org.springframework.data.mongodb.core.MongoTemplate.DocumentCallback#doWith(org.bson.Document)
3220
3247
*/
3248
+ @ Override
3221
3249
@ SuppressWarnings ("unchecked" )
3222
3250
public T doWith (Document document ) {
3223
3251
@@ -3258,6 +3286,7 @@ class QueryCursorPreparer implements CursorPreparer {
3258
3286
* (non-Javadoc)
3259
3287
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.DBCursor)
3260
3288
*/
3289
+ @ Override
3261
3290
public FindIterable <Document > prepare (FindIterable <Document > iterable ) {
3262
3291
3263
3292
FindIterable <Document > cursorToUse = iterable ;
@@ -3376,6 +3405,7 @@ static class GeoNearResultDocumentCallback<T> implements DocumentCallback<GeoRes
3376
3405
this .metric = metric ;
3377
3406
}
3378
3407
3408
+ @ Override
3379
3409
public GeoResult <T > doWith (Document object ) {
3380
3410
3381
3411
double distance = Double .NaN ;
0 commit comments