Hi.
I'm trying to implement custom repository functionality with the spring-data-mongodb M3. I followed the documentation that says:
- Create a simple interface with your custom method
- Create a simple implementation of the interface
- Let your repository interface also extend simple interface, not just CrudRepository
So my custom method should be acessible in addition to the standard CRUD operations containing my hand written code.
But when I start my application, spring tries to build a query from my custom methods' name - and fails of course:
My custom method is called findAll(some, parameters, I, defined, myself, and, Pageable);Code:Caused by: java.lang.IllegalArgumentException: No property find found for type class my.domain.FooObject at org.springframework.data.repository.query.parser.Property.<init>(Property.java:66) at org.springframework.data.repository.query.parser.Property.<init>(Property.java:100) at org.springframework.data.repository.query.parser.Property.create(Property.java:300) at org.springframework.data.repository.query.parser.Property.create(Property.java:314) at org.springframework.data.repository.query.parser.Property.create(Property.java:280) at org.springframework.data.repository.query.parser.Property.from(Property.java:239) at org.springframework.data.repository.query.parser.Property.from(Property.java:227) at org.springframework.data.repository.query.parser.Part.<init>(Part.java:48) at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:242) at org.springframework.data.repository.query.parser.PartTree.buildTree(PartTree.java:101) at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:77) at org.springframework.data.document.mongodb.repository.PartTreeMongoQuery.<init>(PartTreeMongoQuery.java:42) at org.springframework.data.document.mongodb.repository.MongoRepositoryFactoryBean$MongoRepositoryFactory$MongoQueryLookupStrategy.resolveQuery(MongoRepositoryFactoryBean.java:203) at org.springframework.data.repository.support.RepositoryFactorySupport$QueryExecuterMethodInterceptor.<init>(RepositoryFactorySupport.java:290)
So it seems to use the algorithm for auto-generated-query-by-method. But instead it should simply call my custom method on my implementation.
Has anyone an idea why is that?


Reply With Quote