Hi all,
I've made the following Spring Data configuration:
Then I've declared an interface MyCustomRepository:Code:<jpa:repositories base-package="com.my.dao.repositories"> <repository:exclude-filter type="regex" expression="com/my/dao/repositories/.*CustomRepository"/> </jpa:repositories>
The implementation of this interface is in a separate Impl class. The repository interface looks likeCode:public interface MyCustomRepository { /** * a customized repo method */ public SortedMap<Object, Number> findCountOfMyBeansPerYear(final MyBean mb);
If I launch my application, Spring complaints about missing "find" property for MyBean:Code:public interface MyRepository extends PagingAndSortingRepository<MyBean, Long>, MyCustomRepository { }
I'm using Spring Data JPA 1.1.0.RELEASE with Spring 3.1.2.RELEASE. What's wrong with this configuration?Code:Caused by: java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.SortedMap com.my.dao.custom.MyCustomRepository.findCountOfMyBeansPerYear(com.my.beans.Produkt)! at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:92) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:162) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:68) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:280) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:148) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:125) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:41) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 37 more Caused by: java.lang.IllegalArgumentException: No property find found for type class com.my.beans.MyBean at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:73) at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:92) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:319) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:333) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:333) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:333) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:333) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:333) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:301) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:265) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:239) at org.springframework.data.repository.query.parser.Part.<init>(Part.java:70) at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180) at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260) at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240) at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:68) at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:57) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:90)
Thanks in advance,
Ralf.


Reply With Quote