Error creating bean with name 'userRepository': Invocation of init method failed; nested exception

版权声明:来自技术分享,QQ475651575 https://blog.csdn.net/weixin_42045591/article/details/82455743

问题:出现UserRePository注入创建失败,一定先检查所有的@注解是否已经标记

问题发现:entity下的实体类上面没有加注解

@Entity

@Data

@Table(name = "user")

public class User {

任何基于hibernate的实体类一定要加上@Entity注解!

猜你喜欢

转载自blog.csdn.net/weixin_42045591/article/details/82455743