diff --git a/src/main/java/org/springframework/data/mapping/PersistentProperty.java b/src/main/java/org/springframework/data/mapping/PersistentProperty.java index 3d911a0fc..78c730670 100644 --- a/src/main/java/org/springframework/data/mapping/PersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/PersistentProperty.java @@ -30,6 +30,7 @@ import org.springframework.lang.Nullable; * @author Jon Brisbin * @author Oliver Gierke * @author Mark Paluch + * @author Jens Schauder */ public interface PersistentProperty
> { @@ -61,6 +62,16 @@ public interface PersistentProperty
> { */ TypeInformation> getTypeInformation(); + /** + * 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. + * + * @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 @@ -68,7 +79,9 @@ public interface PersistentProperty
> {
*
* @return
*/
- Iterable extends TypeInformation>> getPersistentEntityType();
+ 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
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 569984c1c..c1c83b9ac 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 @@ public abstract class AbstractMappingContext