相关疑难解决方法(0)

缺少CrudRepository#findOne方法

我在我的项目中使用Spring 5.直到今天还有可用的方法CrudRepository#findOne.

但下载最新快照后,它突然消失了!有没有提到该方法现在不可用?

我的依赖列表:

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'


repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}    

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-validation'
    compile 'org.springframework.boot:spring-boot-starter-web'
    compile 'org.springframework.boot:spring-boot-starter-data-jpa'
    runtime 'org.springframework.boot:spring-boot-devtools'

    runtime 'com.h2database:h2:1.4.194'
    compile 'org.projectlombok:lombok:1.16.14'
    compile 'org.modelmapper:modelmapper:0.7.5'


    testCompile 'org.springframework.boot:spring-boot-starter-test'

    testCompile 'org.codehaus.groovy:groovy-all:2.4.10'

    testCompile 'cglib:cglib:3.2.5'
    testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
Run Code Online (Sandbox Code Playgroud)

更新:

似乎这个方法已被替换 CrudRepository#findById

java spring spring-data spring-data-jpa spring-boot

89
推荐指数
4
解决办法
4万
查看次数

标签 统计

java ×1

spring ×1

spring-boot ×1

spring-data ×1

spring-data-jpa ×1