Spring Data JPA Error for 1.7.0.M1查询查找策略异常

时间:2014-08-04 04:50:40

标签: spring jpa

我试图将Spring Data JPA与我的存储库中添加的自定义查询集成。以下错误让我发疯了

"You have defined query method in the repository 
 but you don't have no query lookupstrategy defined.
 The infrastructure apparently does not support query methods!"

有谁能告诉我如何解决这个问题?

2 个答案:

答案 0 :(得分:4)

将spring-data-commons依赖项升级到1.9.0.RELEASE。

<!-- Spring Data JPA -->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>1.9.0.RELEASE</version>
</dependency>

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
    <version>1.7.0.RELEASE</version>
</dependency>

答案 1 :(得分:0)

降级为1.6.2.RELEASE

时解决了
         <!-- Spring Data JPA -->
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <!-- <version>1.7.0.M1</version> -->
        <version>1.6.2.RELEASE</version>
    </dependency>