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> 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> getPersistentEntityType(); + default Iterable> 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 * (non-Javadoc) * @see org.springframework.data.mapping.PersistentProperty#getPersistentEntityType() */ + @Deprecated @Override public Iterable> 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 9e4b817d3..68c5a026b 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 @@ public class AbstractMappingContextIntegrationTests