diff --git a/pom.xml b/pom.xml
index 8ac0ca0ee3..579134d8e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
> { @@ -66,10 +67,22 @@ public interface PersistentProperty
> {
* {@literal null} in case it refers to a simple type. Will return {@link Collection}'s component type or the
* {@link Map}'s value type transparently.
*
- * @return
+ * @Deprecated Use getPersistentEntityTypes instead.
*/
+ @Deprecated
Iterable extends TypeInformation>> getPersistentEntityType();
+ /**
+ * Returns the {@link TypeInformation} if the property references a {@link PersistentEntity}. Will return
+ * {@literal null} in case it refers to a simple type. Will return {@link Collection}'s component type or the
+ * {@link Map}'s value type transparently.
+ *
+ * @return
+ */
+ default Iterable extends TypeInformation>> getPersistentEntityTypes() {
+ return getPersistentEntityType();
+ };
+
/**
* Returns the getter method to access the property value if available. Might return {@literal null} in case there is
* no getter method with a return type assignable to the actual property's type.
diff --git a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java
index 569984c1c8..c1c83b9acc 100644
--- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java
+++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java
@@ -554,7 +554,7 @@ private void createAndRegisterProperty(Property input) {
return;
}
- property.getPersistentEntityType().forEach(AbstractMappingContext.this::addPersistentEntity);
+ property.getPersistentEntityTypes().forEach(AbstractMappingContext.this::addPersistentEntity);
}
}
diff --git a/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java b/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java
index 773efa2b63..35a096dac5 100644
--- a/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java
+++ b/src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java
@@ -133,6 +133,7 @@ public TypeInformation> getTypeInformation() {
* (non-Javadoc)
* @see org.springframework.data.mapping.PersistentProperty#getPersistentEntityType()
*/
+ @Deprecated
@Override
public Iterable extends TypeInformation>> getPersistentEntityType() {
diff --git a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java
index 9e4b817d35..68c5a026bb 100755
--- a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java
+++ b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java
@@ -113,7 +113,7 @@ protected T createPersistentProperty(Property property, BasicPersistentEntity