Browse Source

Polishing.

Simplify KeyMapper current property/index setup.

Original Pull Request: #3689
pull/3701/head
Christoph Strobl 5 years ago
parent
commit
ef29e69a87
  1. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java

@ -1376,10 +1376,9 @@ public class QueryMapper {
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) { MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) {
this.pathParts = Arrays.asList(key.split("\\.")); this.pathParts = Arrays.asList(key.split("\\."));
this.currentPropertyRoot = pathParts.get(0);
this.currentIndex = 0;
this.iterator = pathParts.iterator(); this.iterator = pathParts.iterator();
this.iterator.next(); this.currentPropertyRoot = iterator.next();
this.currentIndex = 0;
} }
/** /**
@ -1391,6 +1390,7 @@ public class QueryMapper {
protected String mapPropertyName(MongoPersistentProperty property) { protected String mapPropertyName(MongoPersistentProperty property) {
StringBuilder mappedName = new StringBuilder(PropertyToFieldNameConverter.INSTANCE.convert(property)); StringBuilder mappedName = new StringBuilder(PropertyToFieldNameConverter.INSTANCE.convert(property));
boolean inspect = iterator.hasNext(); boolean inspect = iterator.hasNext();
while (inspect) { while (inspect) {

Loading…
Cancel
Save