spring jpa - At least one JPA metamodel must be present*

前端 未结 3 1239
谎友^
谎友^ 2021-01-18 11:24

Anybody know why it doesn\'t work?

Error starting ApplicationContext. To display the auto-configuration report re-run your application with \'debug\' enabled         


        
3条回答
  •  不要未来只要你来
    2021-01-18 12:23

    I solved it by adding 2 annotations

    @EnableAutoConfiguration
    @EntityScan(basePackages = { "com.wt.rds" })
    

    and my dependency was in gradle

    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.0.4.RELEASE'
    

提交回复
热议问题