3636import org .bson .Document ;
3737import org .bson .conversions .Bson ;
3838import org .bson .types .ObjectId ;
39-
4039import org .springframework .core .convert .ConversionService ;
4140import org .springframework .core .convert .converter .Converter ;
4241import org .springframework .data .annotation .Reference ;
5756import org .springframework .data .mongodb .core .aggregation .RelaxedTypeBasedAggregationOperationContext ;
5857import org .springframework .data .mongodb .core .convert .MappingMongoConverter .NestedDocument ;
5958import org .springframework .data .mongodb .core .mapping .FieldName ;
60- import org .springframework .data .mongodb .core .mapping .MongoPath .MappedMongoPath ;
61- import org .springframework .data .mongodb .core .mapping .MongoPath .MappedMongoPath .MappedSegment ;
6259import org .springframework .data .mongodb .core .mapping .MongoPath ;
6360import org .springframework .data .mongodb .core .mapping .MongoPath .PathSegment ;
6461import org .springframework .data .mongodb .core .mapping .MongoPaths ;
65- import org .springframework .data .mongodb .core .mapping .MongoPath .RawMongoPath ;
66- import org .springframework .data .mongodb .core .mapping .MongoPath .RawMongoPath .Segment ;
67- import org .springframework .data .mongodb .core .mapping .MongoPath .RawMongoPath .TargetType ;
6862import org .springframework .data .mongodb .core .mapping .MongoPersistentEntity ;
6963import org .springframework .data .mongodb .core .mapping .MongoPersistentProperty ;
7064import org .springframework .data .mongodb .core .query .Query ;
@@ -1140,7 +1134,8 @@ public Class<?> getFieldType() {
11401134 */
11411135 @ Nullable
11421136 public PropertyPath toPropertyPath (
1143- MongoPath mongoPath , MongoPersistentEntity <?> persistentEntity ) {
1137+
1138+ MongoPath mongoPath , MongoPersistentEntity <?> persistentEntity ) {
11441139
11451140 StringBuilder path = new StringBuilder ();
11461141 MongoPersistentEntity <?> entity = persistentEntity ;
@@ -1184,7 +1179,6 @@ public PropertyPath toPropertyPath(
11841179 return PropertyPath .from (path .toString (), persistentEntity .getType ());
11851180 }
11861181
1187-
11881182 /**
11891183 * Extension of {@link Field} to be backed with mapping metadata.
11901184 *
@@ -1331,7 +1325,6 @@ public String getMappedKey() {
13311325 return name ;
13321326 }
13331327
1334-
13351328 @ Nullable
13361329 protected PersistentPropertyPath <MongoPersistentProperty > getPath () {
13371330 return propertyPath ;
@@ -1351,7 +1344,7 @@ private PersistentPropertyPath<MongoPersistentProperty> getPath(MongoPath mongoP
13511344 PropertyPath .from (Pattern .quote (sourceProperty .getName ()), entity .getTypeInformation ()));
13521345 }
13531346
1354- PropertyPath path = toPropertyPath (mongoPath , entity );
1347+ PropertyPath path = paths . mappedPath (mongoPath , entity . getTypeInformation ()). propertyPath ( );
13551348
13561349 if (path == null || isPathToJavaLangClassProperty (path )) {
13571350 return null ;
0 commit comments