
springDataJpa学习之Consider defining a bean of type ‘类名‘ in your your configuration.错误(已解决)
在启动类加上
@EntityScan(“com.motaoyu.spring.data.jpa.entity”) @EnableJpaRepositories(“com.motaoyu.spring.data.jpa.dao”) 两个注解,前一个是扫描entity,后面是扫描dao,这样在其他地方使用dao的时候能够自动注入。没有这两个注解就会出现如上图错误。 谢谢博主:www.tocs/article/16
👁️ 阅读量:0
© 版权声明:本文《springDataJpa学习之Consider defining a bean of type ‘类名‘ in your your configuration.错误(已解决)》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686552313a289880.html。