项目启动时出现错误,创建名称为'entityManagerFac

2019-11-04  本文已影响0人  明爷们儿_d212

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.yunrui.weixin.user.pojo.User

运行项目会出现这种错误。哪里出错???

1.模型类有添加@Entiy注解么,有

2.看看是不是ID 导包倒错了,一定要注意是

导入javax.persistence.Id;

果然 随手写了一个

import org.springframework.data.annotation.Id;

@Id

@GeneratedValue(strategy = GenerationType.IDENTITY)

private Integer id;

上一篇 下一篇

猜你喜欢

热点阅读