DATACMNS-862 - ReturnedInterface now considers interfaces implemented by the domain type.

We now check whether the interface return type is implemented by the domain type and opt out of all projection efforts if so.
This commit is contained in:
Oliver Gierke
2016-06-01 17:50:08 +02:00
parent 5b5daaf397
commit e414cd6801
2 changed files with 20 additions and 4 deletions

View File

@@ -160,7 +160,7 @@ public abstract class ReturnedType {
* @see org.springframework.data.repository.query.ReturnedType#needsCustomConstruction()
*/
public boolean needsCustomConstruction() {
return information.isClosed();
return isProjecting() && information.isClosed();
}
/*
@@ -169,7 +169,7 @@ public abstract class ReturnedType {
*/
@Override
public boolean isProjecting() {
return true;
return !information.getType().isAssignableFrom(domainType);
}
/*
@@ -178,7 +178,7 @@ public abstract class ReturnedType {
*/
@Override
public Class<?> getTypeToRead() {
return information.isClosed() ? null : domainType;
return isProjecting() && information.isClosed() ? null : domainType;
}
/*