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

@@ -167,6 +167,18 @@ public class ReturnedTypeUnitTests {
assertThat(type.isProjecting(), is(false));
}
/**
* @see DATACMNS-862
*/
@Test
public void considersInterfaceImplementedByDomainTypeNotProjecting() throws Exception {
ReturnedType type = getReturnedType("findOneInterface");
assertThat(type.needsCustomConstruction(), is(false));
assertThat(type.isProjecting(), is(false));
}
private static ReturnedType getReturnedType(String methodName, Class<?>... parameters) throws Exception {
return getQueryMethod(methodName, parameters).getResultProcessor().getReturnedType();
}
@@ -206,12 +218,16 @@ public class ReturnedTypeUnitTests {
LocalDateTime timeQuery();
SampleInterface findOneInterface();
static enum MyEnum {
VALUE
}
}
static class Sample {
static interface SampleInterface {}
static class Sample implements SampleInterface {
public String firstname, lastname;
public Sample(String firstname, String lastname) {