Skip to content

Commit f076ed2

Browse files
committed
Fix typo in query limit assertion message of MongoTemplate and ReactiveMongoTemplate.
1 parent f5570aa commit f076ed2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
* @author Michael Krog
189189
* @author Jakub Zurawa
190190
* @author Florian Lüdiger
191+
* @author Seungho Kang
191192
*/
192193
public class MongoTemplate implements MongoOperations, ApplicationContextAware, IndexOperationsProvider,
193194
SearchIndexOperationsProvider, ReadPreferenceAware {
@@ -1159,7 +1160,7 @@ <T, R> GeoResults<R> doGeoNear(NearQuery near, Class<?> domainType, String colle
11591160
Assert.notNull(collectionName, "CollectionName must not be null");
11601161
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");
11611162

1162-
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
1163+
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
11631164
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");
11641165

11651166
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);
@@ -2129,7 +2130,7 @@ protected <S, T> UpdateResult replace(Query query, Class<S> entityType, T replac
21292130
Assert.notNull(entityType, "EntityType must not be null");
21302131
Assert.notNull(collectionName, "CollectionName must not be null");
21312132

2132-
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
2133+
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
21332134
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");
21342135

21352136
UpdateContext updateContext = queryOperations.replaceSingleContext(query,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
* @author Mathieu Ouellet
185185
* @author Yadhukrishna S Pai
186186
* @author Florian Lüdiger
187+
* @author Seungho Kang
187188
* @since 2.0
188189
*/
189190
public class ReactiveMongoTemplate implements ReactiveMongoOperations, ApplicationContextAware {
@@ -1193,7 +1194,7 @@ public <S, T, R> Mono<R> findAndReplace(Query query, S replacement, FindAndRepla
11931194
Assert.notNull(collectionName, "CollectionName must not be null");
11941195
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");
11951196

1196-
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
1197+
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
11971198
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");
11981199

11991200
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);

0 commit comments

Comments
 (0)