国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

java - spring boot不能注入JpaRepository接口,提示找不到bean
伊謝爾倫
伊謝爾倫 2017-06-12 09:27:23
0
2
1304

Field studentRepository in com.example.demo.StudentController required a bean of type 'com.example.demo.StudentRepository' that could not be found.

Action:

Consider defining a bean of type 'com.example.demo.StudentRepository' in your configuration.

@RestController
public class StudentController {

    @Autowired
    private StudentRepository studentRepository;

    @GetMapping(value = "/findAll")
    public List<Student> studentList(){
        return studentRepository.findAll();
    }

}

StudentRepository 繼承 JpaRepository,應該是個最簡單的例子了

一共就一個包,SpringBootApplication和Controller都放在一個包下面,應該不會出現網上的順序的問題

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學PHP伐。

全部回覆(2)
黃舟

StudentRepository 沒有註冊

巴扎黑

我自己解決了,jpa的包包衝突了。

最新下載
更多>
網站特效
網站源碼
網站素材
前端模板