Polishing.

Reformat code. Make getAnnotatedHint non-nullable.

See #3230
Original pull request: #4339
This commit is contained in:
Mark Paluch
2023-04-13 11:50:12 +02:00
parent 7b44f78133
commit 89c6099a3c
6 changed files with 24 additions and 15 deletions

View File

@@ -306,14 +306,15 @@ The `@Hint` annotation allows to override MongoDB's default index selection and
====
[source,java]
----
@Hint("lastname-idx") <1>
@Hint("lastname-idx") <1>
List<Person> findByLastname(String lastname);
@Query(value = "{ 'firstname' : ?0 }", hint="firstname-idx") <2>
@Query(value = "{ 'firstname' : ?0 }", hint = "firstname-idx") <2>
List<Person> findByFirstname(String firstname);
----
<1> Use the index with name `lastname-idx`.
<2> The `@Query` annotation defines the `hint` alias which is equivalent to explicitly adding the `@Hint` annotation.
<2> The `@Query` annotation defines the `hint` alias which is equivalent to adding the `@Hint` annotation.
====
[[mongodb.repositories.queries.update]]