Skip to content

Commit 6e4353e

Browse files
committed
DATAMONGO-1854 - Polishing.
1 parent 741785a commit 6e4353e

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public static Collation of(CollationLocale locale) {
119119
}
120120

121121
/**
122-
* Parse the given collation string into a {@link Collation}.
122+
* Parse the given {@code collation} string into a {@link Collation}.
123123
*
124124
* @param collation the collation to parse. Can be a simple string like {@code en_US} or a
125125
* {@link Document#parse(String) parsable} document like <code>&#123; 'locale' : '?0' &#125;</code> .

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Query.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@
9797
String sort() default "";
9898

9999
/**
100-
* Defines the collation to apply when executing the query. <br />
101-
*
102-
* <pre>
103-
* <code>
100+
* Defines the collation to apply when executing the query.
104101
*
102+
* <pre class="code">
105103
* // Fixed value
106104
* &#64;Query(collation = "en_US")
107105
* List<Entry> findAllByFixedCollation();
@@ -121,7 +119,6 @@
121119
* // SpEL expression
122120
* &#64;Query(collation = "?#{[0]}")
123121
* List<Entry> findAllByDynamicSpElCollation(String collation);
124-
* </code>
125122
* </pre>
126123
*
127124
* @since 2.2

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public boolean hasAnnotatedCollation() {
335335
/**
336336
* Get the collation value extracted from the {@link Query} annotation.
337337
*
338-
* @return the {@link Query#sort()} value.
338+
* @return the {@link Query#collation()} value.
339339
* @throws IllegalStateException if method not annotated with {@link Query}. Make sure to check
340340
* {@link #hasAnnotatedQuery()} first.
341341
* @since 2.2

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/IndexEnsuringQueryCreationListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void onCreation(PartTreeMongoQuery query) {
9696

9797
if (query.getQueryMethod().hasAnnotatedCollation()) {
9898

99+
// TODO: SPEL
99100
String collation = query.getQueryMethod().getAnnotatedCollation();
100101
if (!collation.contains("?")) {
101102
index = index.collation(Collation.parse(collation));

0 commit comments

Comments
 (0)