Prefer considering the value type over the property type at the decision whether to recursively map an object or simply write it as plain value.

Removed obsolete code (probably introduced by invalidly resolving a merge conflict).
This commit is contained in:
Oliver Gierke
2011-03-17 23:04:28 +01:00
parent d69b890a70
commit f41e60a264

View File

@@ -271,17 +271,7 @@ public class MappingMongoConverter implements MongoConverter, ApplicationContext
// Set properties not already set in the constructor
entity.doWithProperties(new PropertyHandler() {
public void doWithPersistentProperty(PersistentProperty prop) {
if (!ctorParamNames.contains(prop.getName())) {
Object obj = getValueInternal(prop, dbo, spelCtx, prop.getValueAnnotation());
try {
MappingBeanHelper.setProperty(instance, prop, obj, useFieldAccessOnly);
} catch (IllegalAccessException e) {
throw new MappingException(e.getMessage(), e);
} catch (InvocationTargetException e) {
throw new MappingException(e.getMessage(), e);
}
}
if (ctorParamNames.contains(prop.getName())) {
return;
}
@@ -381,7 +371,7 @@ public class MappingMongoConverter implements MongoConverter, ApplicationContext
throw new MappingException(e.getMessage(), e);
}
if (null != propertyObj) {
if (prop.isComplexType()) {
if (!MappingBeanHelper.isSimpleType(propertyObj.getClass())) {
writePropertyInternal(prop, propertyObj, dbo);
} else {
dbo.put(name, propertyObj);