diff --git a/pom.xml b/pom.xml index 9be85dfb76..5ae535d2bb 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-commons - 2.5.0-SNAPSHOT + 2.5.0-GH-2293-SNAPSHOT Spring Data Core diff --git a/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java b/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java index bdf9940f56..6d1f76aa41 100644 --- a/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java +++ b/src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java @@ -222,8 +222,7 @@ private Pair, E> getPair(DefaultPersistentPrope return null; } - TypeInformation type = property.getTypeInformation().getRequiredActualType(); - return Pair.of(path.append(property), iterator.hasNext() ? context.getRequiredPersistentEntity(type) : entity); + return Pair.of(path.append(property), iterator.hasNext() ? context.getRequiredPersistentEntity(property) : entity); } private Collection> from(TypeInformation type, Predicate filter, @@ -236,6 +235,12 @@ private Collection> from(TypeInformation type, } E entity = context.getRequiredPersistentEntity(actualType); + return from(entity, filter, traversalGuard, basePath); + } + + private Collection> from(E entity, Predicate filter, Predicate

traversalGuard, + DefaultPersistentPropertyPath

basePath) { + Set> properties = new HashSet<>(); PropertyHandler

propertyTester = persistentProperty -> { @@ -254,7 +259,7 @@ private Collection> from(TypeInformation type, } if (traversalGuard.and(IS_ENTITY).test(persistentProperty)) { - properties.addAll(from(typeInformation, filter, traversalGuard, currentPath)); + properties.addAll(from(context.getPersistentEntity(persistentProperty), filter, traversalGuard, currentPath)); } };