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.
This commit is contained in:
Oliver Gierke
2015-11-23 11:13:07 +01:00
parent d26db17bf0
commit 257bc891dd

View File

@@ -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;
}