wiring into existing spring-boot app fails: "No property findAll found for type..."
See original GitHub issueHello Damien, spring-data-jpa-datatables is just what I was looking for. I was about to implement a direct connector between datatables and a spring rest repository, when I found it. I could run the example project and it works just fine. I’ll post an enhancement for easier testing (CORS Headers) later on. I’d like to integrate your approach into an existing app. I added the dependency and the annotation
@EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class)
to the Application class.
When I start the application, an exception is thrown: org.springframework.data.mapping.PropertyReferenceException: No property findAll found for type Meeting…
In the Interface @Repository public interface MeetingRepository extends PagingAndSortingRepository<Meeting, Long>
several method signatures exist, and I added a DataTablesOutput<Meeting> findAll(DataTablesInput input);
The app uses Spring Boot Starter 1.2.4 . Any ideas why the discovery of the repository methods fails?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Just specifying
repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class
in myApplication
class did the trick.Hi Damien, Thanks for the quick response. And for the very good work!
Sure, I didn’t miss the inheritance so the reason was something else.
The autowiring of the existing repositories failed, if the application is configured to use
@EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class)
for all repos. The solution is to create new repos that extend the exisiting ones, in a distinct package - anyways a good idea to keep existing api stable, and have these repositories interfaces extend theDataTablesRespository
, as you suggest.Then, you can specify that package in
Application.java
@EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class, basePackages = "org.whatever.repository.datatables")
Then the differing factory is only applied to the repositories responsible for datatables.Sorting and paging works fine now. I will continue tomorrow with the search, which does not yet work (it’s supported, right?)
Thanks again for sharing this, it was definitely missing and is worth a mention on datatables.net