Browse Source

capture thoughts on domain type collation resolution

issue/4535
Christoph Strobl 2 years ago
parent
commit
bce4e7b0bb
No known key found for this signature in database
GPG Key ID: 8CC1AB53391458C8
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/DefaultRepositoryActionPreparer.java

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

@ -65,6 +65,8 @@ public class DefaultRepositoryActionPreparer implements RepositoryActionPreparer
metadata.getReadPreference().ifPresent(it -> action.getQuery().withReadPreference(it)); metadata.getReadPreference().ifPresent(it -> action.getQuery().withReadPreference(it));
if (!action.getQuery().getCollation().isPresent()) { if (!action.getQuery().getCollation().isPresent()) {
metadata.getCollation().map(this::resolveCollation) metadata.getCollation().map(this::resolveCollation)
// should we even bother about the domain type collation here?
// the template API will add it if not present anyway.
.or(() -> Optional.ofNullable(action.getDomainTypeInformation().getCollation())) .or(() -> Optional.ofNullable(action.getDomainTypeInformation().getCollation()))
.ifPresent(it -> action.getQuery().collation(it)); .ifPresent(it -> action.getQuery().collation(it));
} }

Loading…
Cancel
Save