@@ -419,7 +419,7 @@ public MongoConverter getConverter() {
419
419
@ Override
420
420
public <T > CloseableIterator <T > stream (final Query query , final Class <T > entityType ) {
421
421
422
- return stream (query , entityType , operations . determineCollectionName (entityType ));
422
+ return stream (query , entityType , getCollectionName (entityType ));
423
423
}
424
424
425
425
/*
@@ -565,7 +565,7 @@ public <T> T execute(DbCallback<T> action) {
565
565
public <T > T execute (Class <?> entityClass , CollectionCallback <T > callback ) {
566
566
567
567
Assert .notNull (entityClass , "EntityClass must not be null!" );
568
- return execute (operations . determineCollectionName (entityClass ), callback );
568
+ return execute (getCollectionName (entityClass ), callback );
569
569
}
570
570
571
571
/*
@@ -643,7 +643,7 @@ public <T> MongoCollection<Document> createCollection(Class<T> entityClass,
643
643
() -> operations .forType (entityClass ).getCollation ()) //
644
644
.map (options ::collation ).orElse (options );
645
645
646
- return doCreateCollection (operations . determineCollectionName (entityClass ), convertToDocument (options , entityClass ));
646
+ return doCreateCollection (getCollectionName (entityClass ), convertToDocument (options , entityClass ));
647
647
}
648
648
649
649
/*
@@ -685,7 +685,7 @@ public MongoCollection<Document> getCollection(final String collectionName) {
685
685
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollection(java.lang.Class)
686
686
*/
687
687
public <T > boolean collectionExists (Class <T > entityClass ) {
688
- return collectionExists (operations . determineCollectionName (entityClass ));
688
+ return collectionExists (getCollectionName (entityClass ));
689
689
}
690
690
691
691
/*
@@ -713,7 +713,7 @@ public boolean collectionExists(final String collectionName) {
713
713
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#dropCollection(java.lang.Class)
714
714
*/
715
715
public <T > void dropCollection (Class <T > entityClass ) {
716
- dropCollection (operations . determineCollectionName (entityClass ));
716
+ dropCollection (getCollectionName (entityClass ));
717
717
}
718
718
719
719
/*
@@ -749,7 +749,7 @@ public IndexOperations indexOps(String collectionName) {
749
749
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#indexOps(java.lang.Class)
750
750
*/
751
751
public IndexOperations indexOps (Class <?> entityClass ) {
752
- return new DefaultIndexOperations (this , operations . determineCollectionName (entityClass ), entityClass );
752
+ return new DefaultIndexOperations (this , getCollectionName (entityClass ), entityClass );
753
753
}
754
754
755
755
/*
@@ -765,7 +765,7 @@ public BulkOperations bulkOps(BulkMode bulkMode, String collectionName) {
765
765
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.Class)
766
766
*/
767
767
public BulkOperations bulkOps (BulkMode bulkMode , Class <?> entityClass ) {
768
- return bulkOps (bulkMode , entityClass , operations . determineCollectionName (entityClass ));
768
+ return bulkOps (bulkMode , entityClass , getCollectionName (entityClass ));
769
769
}
770
770
771
771
/*
@@ -800,7 +800,7 @@ public ScriptOperations scriptOps() {
800
800
@ Nullable
801
801
@ Override
802
802
public <T > T findOne (Query query , Class <T > entityClass ) {
803
- return findOne (query , entityClass , operations . determineCollectionName (entityClass ));
803
+ return findOne (query , entityClass , getCollectionName (entityClass ));
804
804
}
805
805
806
806
@ Nullable
@@ -825,7 +825,7 @@ public <T> T findOne(Query query, Class<T> entityClass, String collectionName) {
825
825
826
826
@ Override
827
827
public boolean exists (Query query , Class <?> entityClass ) {
828
- return exists (query , entityClass , operations . determineCollectionName (entityClass ));
828
+ return exists (query , entityClass , getCollectionName (entityClass ));
829
829
}
830
830
831
831
@ Override
@@ -856,7 +856,7 @@ public boolean exists(Query query, @Nullable Class<?> entityClass, String collec
856
856
*/
857
857
@ Override
858
858
public <T > List <T > find (Query query , Class <T > entityClass ) {
859
- return find (query , entityClass , operations . determineCollectionName (entityClass ));
859
+ return find (query , entityClass , getCollectionName (entityClass ));
860
860
}
861
861
862
862
/*
@@ -877,7 +877,7 @@ public <T> List<T> find(Query query, Class<T> entityClass, String collectionName
877
877
@ Nullable
878
878
@ Override
879
879
public <T > T findById (Object id , Class <T > entityClass ) {
880
- return findById (id , entityClass , operations . determineCollectionName (entityClass ));
880
+ return findById (id , entityClass , getCollectionName (entityClass ));
881
881
}
882
882
883
883
@ Nullable
@@ -899,7 +899,7 @@ public <T> T findById(Object id, Class<T> entityClass, String collectionName) {
899
899
*/
900
900
@ Override
901
901
public <T > List <T > findDistinct (Query query , String field , Class <?> entityClass , Class <T > resultClass ) {
902
- return findDistinct (query , field , operations . determineCollectionName (entityClass ), entityClass , resultClass );
902
+ return findDistinct (query , field , getCollectionName (entityClass ), entityClass , resultClass );
903
903
}
904
904
905
905
/*
@@ -986,7 +986,7 @@ private static Class<?> getMostSpecificConversionTargetType(Class<?> userType, C
986
986
987
987
@ Override
988
988
public <T > GeoResults <T > geoNear (NearQuery near , Class <T > entityClass ) {
989
- return geoNear (near , entityClass , operations . determineCollectionName (entityClass ));
989
+ return geoNear (near , entityClass , getCollectionName (entityClass ));
990
990
}
991
991
992
992
@ Override
@@ -1008,7 +1008,7 @@ public <T> GeoResults<T> geoNear(NearQuery near, Class<?> domainType, String col
1008
1008
Assert .notNull (returnType , "ReturnType must not be null!" );
1009
1009
1010
1010
String collection = StringUtils .hasText (collectionName ) ? collectionName
1011
- : operations . determineCollectionName (domainType );
1011
+ : getCollectionName (domainType );
1012
1012
String distanceField = operations .nearQueryDistanceFieldName (domainType );
1013
1013
1014
1014
Aggregation $geoNear = TypedAggregation .newAggregation (domainType , Aggregation .geoNear (near , distanceField ))
@@ -1040,7 +1040,7 @@ public <T> GeoResults<T> geoNear(NearQuery near, Class<?> domainType, String col
1040
1040
@ Override
1041
1041
public <T > T findAndModify (Query query , Update update , Class <T > entityClass ) {
1042
1042
return findAndModify (query , update , new FindAndModifyOptions (), entityClass ,
1043
- operations . determineCollectionName (entityClass ));
1043
+ getCollectionName (entityClass ));
1044
1044
}
1045
1045
1046
1046
@ Nullable
@@ -1052,7 +1052,7 @@ public <T> T findAndModify(Query query, Update update, Class<T> entityClass, Str
1052
1052
@ Nullable
1053
1053
@ Override
1054
1054
public <T > T findAndModify (Query query , Update update , FindAndModifyOptions options , Class <T > entityClass ) {
1055
- return findAndModify (query , update , options , entityClass , operations . determineCollectionName (entityClass ));
1055
+ return findAndModify (query , update , options , entityClass , getCollectionName (entityClass ));
1056
1056
}
1057
1057
1058
1058
@ Nullable
@@ -1122,7 +1122,7 @@ public <S, T> T findAndReplace(Query query, S replacement, FindAndReplaceOptions
1122
1122
@ Nullable
1123
1123
@ Override
1124
1124
public <T > T findAndRemove (Query query , Class <T > entityClass ) {
1125
- return findAndRemove (query , entityClass , operations . determineCollectionName (entityClass ));
1125
+ return findAndRemove (query , entityClass , getCollectionName (entityClass ));
1126
1126
}
1127
1127
1128
1128
@ Nullable
@@ -1142,7 +1142,7 @@ public <T> T findAndRemove(Query query, Class<T> entityClass, String collectionN
1142
1142
public long count (Query query , Class <?> entityClass ) {
1143
1143
1144
1144
Assert .notNull (entityClass , "Entity class must not be null!" );
1145
- return count (query , entityClass , operations . determineCollectionName (entityClass ));
1145
+ return count (query , entityClass , getCollectionName (entityClass ));
1146
1146
}
1147
1147
1148
1148
@ Override
@@ -1296,7 +1296,7 @@ public <T> Collection<T> insert(Collection<? extends T> batchToSave, Class<?> en
1296
1296
1297
1297
Assert .notNull (batchToSave , "BatchToSave must not be null!" );
1298
1298
1299
- return (Collection <T >) doInsertBatch (operations . determineCollectionName (entityClass ), batchToSave ,
1299
+ return (Collection <T >) doInsertBatch (getCollectionName (entityClass ), batchToSave ,
1300
1300
this .mongoConverter );
1301
1301
}
1302
1302
@@ -1557,7 +1557,7 @@ public Object doInCollection(MongoCollection<Document> collection) throws MongoE
1557
1557
1558
1558
@ Override
1559
1559
public UpdateResult upsert (Query query , Update update , Class <?> entityClass ) {
1560
- return doUpdate (operations . determineCollectionName (entityClass ), query , update , entityClass , true , false );
1560
+ return doUpdate (getCollectionName (entityClass ), query , update , entityClass , true , false );
1561
1561
}
1562
1562
1563
1563
@ Override
@@ -1575,7 +1575,7 @@ public UpdateResult upsert(Query query, Update update, Class<?> entityClass, Str
1575
1575
1576
1576
@ Override
1577
1577
public UpdateResult updateFirst (Query query , Update update , Class <?> entityClass ) {
1578
- return doUpdate (operations . determineCollectionName (entityClass ), query , update , entityClass , false , false );
1578
+ return doUpdate (getCollectionName (entityClass ), query , update , entityClass , false , false );
1579
1579
}
1580
1580
1581
1581
@ Override
@@ -1593,7 +1593,7 @@ public UpdateResult updateFirst(Query query, Update update, Class<?> entityClass
1593
1593
1594
1594
@ Override
1595
1595
public UpdateResult updateMulti (Query query , Update update , Class <?> entityClass ) {
1596
- return doUpdate (operations . determineCollectionName (entityClass ), query , update , entityClass , false , true );
1596
+ return doUpdate (getCollectionName (entityClass ), query , update , entityClass , false , true );
1597
1597
}
1598
1598
1599
1599
@ Override
@@ -1692,7 +1692,7 @@ public DeleteResult remove(Object object) {
1692
1692
1693
1693
Assert .notNull (object , "Object must not be null!" );
1694
1694
1695
- return remove (object , operations . determineCollectionName (object .getClass ()));
1695
+ return remove (object , getCollectionName (object .getClass ()));
1696
1696
}
1697
1697
1698
1698
@ Override
@@ -1713,7 +1713,7 @@ public DeleteResult remove(Query query, String collectionName) {
1713
1713
1714
1714
@ Override
1715
1715
public DeleteResult remove (Query query , Class <?> entityClass ) {
1716
- return remove (query , entityClass , operations . determineCollectionName (entityClass ));
1716
+ return remove (query , entityClass , getCollectionName (entityClass ));
1717
1717
}
1718
1718
1719
1719
@ Override
@@ -1785,7 +1785,7 @@ protected <T> DeleteResult doRemove(final String collectionName, final Query que
1785
1785
1786
1786
@ Override
1787
1787
public <T > List <T > findAll (Class <T > entityClass ) {
1788
- return findAll (entityClass , operations . determineCollectionName (entityClass ));
1788
+ return findAll (entityClass , getCollectionName (entityClass ));
1789
1789
}
1790
1790
1791
1791
@ Override
@@ -1988,7 +1988,7 @@ public <T> GroupByResults<T> group(@Nullable Criteria criteria, String inputColl
1988
1988
*/
1989
1989
@ Override
1990
1990
public <O > AggregationResults <O > aggregate (TypedAggregation <?> aggregation , Class <O > outputType ) {
1991
- return aggregate (aggregation , operations . determineCollectionName (aggregation .getInputType ()), outputType );
1991
+ return aggregate (aggregation , getCollectionName (aggregation .getInputType ()), outputType );
1992
1992
}
1993
1993
1994
1994
/* (non-Javadoc)
@@ -2011,7 +2011,7 @@ public <O> AggregationResults<O> aggregate(TypedAggregation<?> aggregation, Stri
2011
2011
@ Override
2012
2012
public <O > AggregationResults <O > aggregate (Aggregation aggregation , Class <?> inputType , Class <O > outputType ) {
2013
2013
2014
- return aggregate (aggregation , operations . determineCollectionName (inputType ), outputType ,
2014
+ return aggregate (aggregation , getCollectionName (inputType ), outputType ,
2015
2015
new TypeBasedAggregationOperationContext (inputType , mappingContext , queryMapper ));
2016
2016
}
2017
2017
@@ -2042,7 +2042,7 @@ public <O> CloseableIterator<O> aggregateStream(TypedAggregation<?> aggregation,
2042
2042
*/
2043
2043
@ Override
2044
2044
public <O > CloseableIterator <O > aggregateStream (TypedAggregation <?> aggregation , Class <O > outputType ) {
2045
- return aggregateStream (aggregation , operations . determineCollectionName (aggregation .getInputType ()), outputType );
2045
+ return aggregateStream (aggregation , getCollectionName (aggregation .getInputType ()), outputType );
2046
2046
}
2047
2047
2048
2048
/* (non-Javadoc)
@@ -2051,7 +2051,7 @@ public <O> CloseableIterator<O> aggregateStream(TypedAggregation<?> aggregation,
2051
2051
@ Override
2052
2052
public <O > CloseableIterator <O > aggregateStream (Aggregation aggregation , Class <?> inputType , Class <O > outputType ) {
2053
2053
2054
- return aggregateStream (aggregation , operations . determineCollectionName (inputType ), outputType ,
2054
+ return aggregateStream (aggregation , getCollectionName (inputType ), outputType ,
2055
2055
new TypeBasedAggregationOperationContext (inputType , mappingContext , queryMapper ));
2056
2056
}
2057
2057
@@ -2077,7 +2077,7 @@ public <T> List<T> findAllAndRemove(Query query, String collectionName) {
2077
2077
*/
2078
2078
@ Override
2079
2079
public <T > List <T > findAllAndRemove (Query query , Class <T > entityClass ) {
2080
- return findAllAndRemove (query , entityClass , operations . determineCollectionName (entityClass ));
2080
+ return findAllAndRemove (query , entityClass , getCollectionName (entityClass ));
2081
2081
}
2082
2082
2083
2083
/* (non-Javadoc)
0 commit comments