DATACMNS-840 - ReturnedType's need for custom construction no includes availability of input properties.
The indicator of whether custom construction is needed for a class based return type now includes whether input properties are available in the first place.
This commit is contained in:
@@ -262,7 +262,7 @@ public abstract class ReturnedType {
|
||||
* @see org.springframework.data.repository.query.ResultFactory.ReturnedType#needsCustomConstruction()
|
||||
*/
|
||||
public boolean needsCustomConstruction() {
|
||||
return isDto();
|
||||
return isDto() && !inputProperties.isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -139,6 +139,7 @@ public class ReturnedTypeUnitTests {
|
||||
ReturnedType type = getReturnedType("dtoWithMultipleConstructors");
|
||||
|
||||
assertThat(type.getInputProperties(), is(empty()));
|
||||
assertThat(type.needsCustomConstruction(), is(false));
|
||||
}
|
||||
|
||||
private static ReturnedType getReturnedType(String methodName, Class<?>... parameters) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user