无法解析org.springframework.data.repository.PagingAndSortingRepository类型。从所需的.class文件间接引用它

Cha*_*han 5 spring-boot

[在此处输入图片描述] [1]这个问题出了什么问题?我该如何解决

无法解析类型org.springframework.data.repository.PagingAndSortingRepository

这是我的下面的代码

package repository;

import org.springframework.data.jpa.repository.JpaRepository;

import model.Student;

public interface StudentRepository extends **JpaRepository**<Student, Integer>{

}
Run Code Online (Sandbox Code Playgroud)

小智 8

这个为我解决了问题

摇篮

// https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '2.0.1.RELEASE'
Run Code Online (Sandbox Code Playgroud)

马文

<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
    <version>2.0.1.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)


Mar*_*rco 5

我解决了这个问题spring-data-commons,包括PagingAndSortingRepository

<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons -->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>2.0.1.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明