Skip to content

Commit 81aba29

Browse files
committed
DATAJDBC-546 - Skip property population if entity can be constructed entirely using a full constructor.
1 parent 24ce2a9 commit 81aba29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/BasicJdbcConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ T mapRow() {
395395
private T populateProperties(T instance, @Nullable Object idValue) {
396396

397397
PersistentPropertyAccessor<T> propertyAccessor = getPropertyAccessor(entity, instance);
398-
399398
PreferredConstructor<T, RelationalPersistentProperty> persistenceConstructor = entity.getPersistenceConstructor();
400399

401400
for (RelationalPersistentProperty property : entity) {
@@ -539,7 +538,8 @@ private T createInstanceInternal(@Nullable Object idValue) {
539538
RelationalPersistentProperty property = entity.getRequiredPersistentProperty(parameterName);
540539
return readOrLoadProperty(idValue, property);
541540
});
542-
return populateProperties(instance, idValue);
541+
542+
return entity.requiresPropertyPopulation() ? populateProperties(instance, idValue) : instance;
543543
}
544544

545545
}

0 commit comments

Comments
 (0)