最佳答案
我在我的项目中使用 Spring5。直到今天还有可用的方法 CrudRepository#findOne
。
But after downloading latest snapshot it suddenly disappeared! Is there any reference that the method is not available now?
我的依赖清单:
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-data-jpa'
runtime 'com.h2database:h2:1.4.194'
}
更新:
看起来这个方法已经被 CrudRepository#findById
代替了