@ -38,6 +38,7 @@ import org.springframework.data.projection.ProjectionFactory;
@@ -38,6 +38,7 @@ import org.springframework.data.projection.ProjectionFactory;
import org.springframework.data.projection.SpelAwareProxyProjectionFactory ;
import org.springframework.data.repository.Repository ;
import org.springframework.data.repository.core.RepositoryMetadata ;
import org.springframework.data.repository.core.support.AbstractRepositoryMetadata ;
import org.springframework.data.repository.core.support.DefaultRepositoryMetadata ;
import org.springframework.data.util.Version ;
@ -221,6 +222,15 @@ public class QueryMethodUnitTests {
@@ -221,6 +222,15 @@ public class QueryMethodUnitTests {
assertThat ( new QueryMethod ( method , repositoryMetadata , factory ) . isCollectionQuery ( ) , is ( true ) ) ;
}
@Test // DATACMNS-1300
public void doesNotConsiderMethodForIterableAggregateACollectionQuery ( ) throws Exception {
RepositoryMetadata metadata = AbstractRepositoryMetadata . getMetadata ( ContainerRepository . class ) ;
Method method = ContainerRepository . class . getMethod ( "someMethod" ) ;
assertThat ( new QueryMethod ( method , metadata , factory ) . isCollectionQuery ( ) , is ( false ) ) ;
}
interface SampleRepository extends Repository < User , Serializable > {
String pagingMethodWithInvalidReturnType ( Pageable pageable ) ;
@ -274,4 +284,14 @@ public class QueryMethodUnitTests {
@@ -274,4 +284,14 @@ public class QueryMethodUnitTests {
class SpecialUser extends User {
}
// DATACMNS-1300
class Element { }
abstract class Container implements Iterable < Element > { }
interface ContainerRepository extends Repository < Container , Long > {
Container someMethod ( ) ;
}
}