Skip to content

Commit 81f85b8

Browse files
committed
Polishing.
Tweak Javadoc, make ViewOptions.collation final. See: #2594 Original pull request: #4142.
1 parent 77f318b commit 81f85b8

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ public <T> T execute(SessionCallback<T> action, Consumer<ClientSession> onComple
283283
MongoCollection<Document> createCollection(String collectionName, @Nullable CollectionOptions collectionOptions);
284284

285285
/**
286-
* Create a view with the the provided name whose contents are defined by the {@link AggregationOperation pipeline
286+
* Create a view with the provided name. The view content is defined by the {@link AggregationOperation pipeline
287287
* stages} on another collection or view identified by the given {@link #getCollectionName(Class) source type}.
288-
*
288+
*
289289
* @param name the name of the view to create.
290290
* @param source the type defining the views source collection.
291291
* @param stages the {@link AggregationOperation aggregation pipeline stages} defining the view content.
@@ -296,7 +296,7 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
296296
}
297297

298298
/**
299-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
299+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
300300
* another collection or view identified by the given {@link #getCollectionName(Class) source type}.
301301
*
302302
* @param name the name of the view to create.
@@ -309,7 +309,7 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
309309
}
310310

311311
/**
312-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
312+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
313313
* another collection or view identified by the given {@link #getCollectionName(Class) source type}.
314314
*
315315
* @param name the name of the view to create.
@@ -321,7 +321,7 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
321321
MongoCollection<Document> createView(String name, Class<?> source, AggregationPipeline pipeline, @Nullable ViewOptions options);
322322

323323
/**
324-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
324+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
325325
* another collection or view identified by the given source.
326326
*
327327
* @param name the name of the view to create.
@@ -1593,7 +1593,7 @@ default long exactCount(Query query, String collectionName) {
15931593
DeleteResult remove(Object object, String collectionName);
15941594

15951595
/**
1596-
* Remove all documents that match the provided query document criteria from the the collection used to store the
1596+
* Remove all documents that match the provided query document criteria from the collection used to store the
15971597
* entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the query.
15981598
*
15991599
* @param query the query document that specifies the criteria used to remove a record.
@@ -1604,7 +1604,7 @@ default long exactCount(Query query, String collectionName) {
16041604
DeleteResult remove(Query query, Class<?> entityClass);
16051605

16061606
/**
1607-
* Remove all documents that match the provided query document criteria from the the collection used to store the
1607+
* Remove all documents that match the provided query document criteria from the collection used to store the
16081608
* entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the query.
16091609
*
16101610
* @param query the query document that specifies the criteria used to remove a record.
@@ -1652,9 +1652,9 @@ default long exactCount(Query query, String collectionName) {
16521652
<T> List<T> findAllAndRemove(Query query, Class<T> entityClass);
16531653

16541654
/**
1655-
* Returns and removes all documents that match the provided query document criteria from the the collection used to
1656-
* store the entityClass. The Class parameter is also used to help convert the Id of the object if it is present in
1657-
* the query.
1655+
* Returns and removes all documents that match the provided query document criteria from the collection used to store
1656+
* the entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the
1657+
* query.
16581658
*
16591659
* @param query the query document that specifies the criteria used to find and remove documents.
16601660
* @param entityClass class of the pojo to be operated on.

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package org.springframework.data.mongodb.core;
1717

18-
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
19-
import org.springframework.data.mongodb.core.aggregation.AggregationPipeline;
2018
import reactor.core.publisher.Flux;
2119
import reactor.core.publisher.Mono;
2220

@@ -27,10 +25,13 @@
2725
import org.bson.Document;
2826
import org.reactivestreams.Publisher;
2927
import org.reactivestreams.Subscription;
28+
3029
import org.springframework.data.geo.GeoResult;
3130
import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory;
3231
import org.springframework.data.mongodb.core.aggregation.Aggregation;
32+
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
3333
import org.springframework.data.mongodb.core.aggregation.AggregationOptions;
34+
import org.springframework.data.mongodb.core.aggregation.AggregationPipeline;
3435
import org.springframework.data.mongodb.core.aggregation.AggregationUpdate;
3536
import org.springframework.data.mongodb.core.aggregation.TypedAggregation;
3637
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
@@ -243,7 +244,7 @@ <T> Mono<MongoCollection<Document>> createCollection(Class<T> entityClass,
243244
Mono<MongoCollection<Document>> createCollection(String collectionName, CollectionOptions collectionOptions);
244245

245246
/**
246-
* Create a view with the the provided name whose contents are defined by the {@link AggregationOperation pipeline
247+
* Create a view with the provided name. The view content is defined by the {@link AggregationOperation pipeline
247248
* stages} on another collection or view identified by the given {@link #getCollectionName(Class) source type}.
248249
*
249250
* @param name the name of the view to create.
@@ -256,7 +257,7 @@ default Mono<MongoCollection<Document>> createView(String name, Class<?> source,
256257
}
257258

258259
/**
259-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
260+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
260261
* another collection or view identified by the given {@link #getCollectionName(Class) source type}.
261262
*
262263
* @param name the name of the view to create.
@@ -269,7 +270,7 @@ default Mono<MongoCollection<Document>> createView(String name, Class<?> source,
269270
}
270271

271272
/**
272-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
273+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
273274
* another collection or view identified by the given {@link #getCollectionName(Class) source type}.
274275
*
275276
* @param name the name of the view to create.
@@ -281,7 +282,7 @@ default Mono<MongoCollection<Document>> createView(String name, Class<?> source,
281282
Mono<MongoCollection<Document>> createView(String name, Class<?> source, AggregationPipeline pipeline, @Nullable ViewOptions options);
282283

283284
/**
284-
* Create a view with the the provided name whose contents are defined by the {@link AggregationPipeline pipeline} on
285+
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
285286
* another collection or view identified by the given source.
286287
*
287288
* @param name the name of the view to create.
@@ -1445,7 +1446,7 @@ default Mono<Long> exactCount(Query query, String collectionName) {
14451446
Mono<DeleteResult> remove(Mono<? extends Object> objectToRemove, String collectionName);
14461447

14471448
/**
1448-
* Remove all documents that match the provided query document criteria from the the collection used to store the
1449+
* Remove all documents that match the provided query document criteria from the collection used to store the
14491450
* entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the query.
14501451
*
14511452
* @param query the query document that specifies the criteria used to remove a record.
@@ -1455,7 +1456,7 @@ default Mono<Long> exactCount(Query query, String collectionName) {
14551456
Mono<DeleteResult> remove(Query query, Class<?> entityClass);
14561457

14571458
/**
1458-
* Remove all documents that match the provided query document criteria from the the collection used to store the
1459+
* Remove all documents that match the provided query document criteria from the collection used to store the
14591460
* entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the query.
14601461
*
14611462
* @param query the query document that specifies the criteria used to remove a record.
@@ -1498,9 +1499,9 @@ default Mono<Long> exactCount(Query query, String collectionName) {
14981499
<T> Flux<T> findAllAndRemove(Query query, Class<T> entityClass);
14991500

15001501
/**
1501-
* Returns and removes all documents that match the provided query document criteria from the the collection used to
1502-
* store the entityClass. The Class parameter is also used to help convert the Id of the object if it is present in
1503-
* the query.
1502+
* Returns and removes all documents that match the provided query document criteria from the collection used to store
1503+
* the entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the
1504+
* query.
15041505
*
15051506
* @param query the query document that specifies the criteria used to find and remove documents.
15061507
* @param entityClass class of the pojo to be operated on.

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ViewOptions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
/**
2424
* Immutable object holding additional options to be applied when creating a MongoDB
2525
* <a href="https://www.mongodb.com/docs/manual/core/views/">views</a>.
26-
*
26+
*
2727
* @author Christoph Strobl
2828
* @since 4.0
2929
*/
3030
public class ViewOptions {
3131

32-
@Nullable private Collation collation;
32+
private final @Nullable Collation collation;
3333

3434
static ViewOptions none() {
3535
return new ViewOptions();

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateViewTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
import com.mongodb.client.MongoClient;
4242

4343
/**
44+
* Integration tests for Views.
45+
*
4446
* @author Christoph Strobl
4547
*/
4648
@ExtendWith(MongoClientExtension.class)

0 commit comments

Comments
 (0)