you can only return Page objects from methods with a pageable parameter

> Am 04.06.2015 um 06:25 schrieb anshul goel <[email protected]>:
> 
> I have the following GraphRepository class for Feed.
> 
> public interface FeedRepository extends GraphRepository<Feed>, 
> RelationshipOperationsRepository<Feed>{
> 
>     Feed findById(Long id);
>     List<Feed> findByFeedType(String feedtype); 
>     @Query("match (user:User {username:{0}}), (f:Feed) where f.feedType in 
> {1} "
>             + "with user,f "
>             + "order by f.timeAdded desc "
>             + "optional match (user)-[r:LIKED]->(f) "
>             + "return f, count(r)")
>     Iterable<Map<String, Object>> getAllFeeds(String username, String[] 
> typeFilter, Pageable pageable);
> 
> }
> Getting the following error while compiling the code. I am using Spring Data 
> neo4j version 3.
> 
> Caused by: java.lang.IllegalStateException: Method has to have one of the 
> following return types! [interface org.springframework.data.domain.Slice, 
> interface org.springframework.data.domain.Page, interface java.util.List] at 
> org.springframework.data.repository.util.ClassUtils.assertReturnTypeAssignable(ClassUtils.java:112)
>  at 
> org.springframework.data.repository.query.QueryMethod.(QueryMethod.java:73) 
> at 
> org.springframework.data.neo4j.repository.query.GraphQueryMethod.(GraphQueryMethod.java:45)
>  at 
> org.springframework.data.neo4j.repository.GraphRepositoryFactory$1.resolveQuery(GraphRepositoryFactory.java:112)
>  at 
> org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.(RepositoryFactorySupport.java:347)
>  at 
> org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:185)
>  at 
> org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:239)
>  at 
> org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:225)
>  at 
> org.springframework.data.neo4j.repository.GraphRepositoryFactoryBean.afterPropertiesSet(GraphRepositoryFactoryBean.java:70)
>  at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
>  at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to