Browse Source

DATAMONGO-1287 - Optimizations in reading associations as constructor arguments.

As per discussion on the ticket we now omit looking up the value for an association being used as constructor argument as the simple check whether the currently handled property is a constructor argument is sufficient to potentially skip handling the value.

Related pull requests: #335, #322.
pull/336/head
Oliver Gierke 10 years ago
parent
commit
95f6dfafdd
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java

@ -291,7 +291,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App @@ -291,7 +291,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
final MongoPersistentProperty property = association.getInverse();
Object value = dbo.get(property.getFieldName());
if (value == null || (entity.isConstructorArgument(property) && accessor.getProperty(property) != null)) {
if (value == null || entity.isConstructorArgument(property)) {
return;
}

Loading…
Cancel
Save