spring-projects / spring-data-rest

Simplifies building hypermedia-driven REST web services on top of Spring Data repositories
https://spring.io/projects/spring-data-rest
Apache License 2.0
917 stars 563 forks source link

wrong findAll method when Repository extends QueryDslPredicateExecutor [DATAREST-81] #466

Open spring-projects-issues opened 11 years ago

spring-projects-issues commented 11 years ago

Kathleen Van Assche opened DATAREST-81 and commented

I have a repository defined as

public interface AlbumRepository extends MongoRepository<Album, ObjectId>, QueryDslPredicateExecutor\

When the RepositoryMethodInvoker is created, the findAll property is set to the method 'public abstract java.lang.Iterable org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.mysema.query.types.Predicate)'. This causes a IllegalArgumentException when the RepositoryEntityController.listEntities calls repoMethodInvoker.findAll().

I attach a demo project (extract of my own project stripped to the bare minimum to reproduce the error). Error occurs when the url http://localhost:8080/test/album is called.


Attachments:

spring-projects-issues commented 11 years ago

Dewi commented

The same thing happens with

public interface XXX extends PagingAndSortingRepository<XXX, Long>, JpaSpecificationExecutor\

You end up with this logged:

ERROR org.springframework.data.rest.webmvc.RepositoryEntityController.errorResponse:224 - wrong number of arguments

This is a bit of a show-stopper. Any chance of bumping the severity up?

spring-projects-issues commented 11 years ago

Dewi commented

To add to my previous comment, re-ordering the declaration to:

public interface XXX extends JpaSpecificationExecutor\, PagingAndSortingRepository<XXX, Long>

is a work-around