From b5727d4bf292702c8ac35b8556e45c5fac82fbe6 Mon Sep 17 00:00:00 2001 From: Michael Hunger Date: Sun, 23 Feb 2014 02:01:09 +0100 Subject: [PATCH] DATACMNS-447 - Soften too strict strickt-check in MappingContext. Previously we directly threw a MappingException in MappingContext.getPersistentEntity(TypeInformation) when the MappingContext was in strict mode and we were given a TypeInformation for which we didn't have a PersistentEntity already. We now first check whether we should actually create a PersistentEntity for the given TypeInformation if no PersistentEntity is available, before throwing a MappingException - if we should not then we simply return null (e.g. for simple types like Integer or Double). Original pull requests: #66, #71. --- .../mapping/context/AbstractMappingContext.java | 10 ++++++---- .../context/AbstractMappingContextUnitTests.java | 13 ++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) 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 3e7bfaf28..ae8cbef2c 100644 --- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java @@ -61,6 +61,8 @@ import org.springframework.util.ReflectionUtils.FieldFilter; * @param P the concrete {@link PersistentProperty} type the {@link MappingContext} implementation creates * @author Jon Brisbin * @author Oliver Gierke + * @author Michael Hunger + * @author Thomas Darimont */ public abstract class AbstractMappingContext, P extends PersistentProperty

> implements MappingContext, ApplicationEventPublisherAware, InitializingBean { @@ -168,14 +170,14 @@ public abstract class AbstractMappingContext