Skip to content

Commit 95f6dfa

Browse files
committed
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: spring-projects#335, spring-projects#322.
1 parent bedaae8 commit 95f6dfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public void doWithAssociation(Association<MongoPersistentProperty> association)
291291
final MongoPersistentProperty property = association.getInverse();
292292
Object value = dbo.get(property.getFieldName());
293293

294-
if (value == null || (entity.isConstructorArgument(property) && accessor.getProperty(property) != null)) {
294+
if (value == null || entity.isConstructorArgument(property)) {
295295
return;
296296
}
297297

0 commit comments

Comments
 (0)