如题
完整报错如下
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.demo3.pojo.Admin
该加的全加了,搜到的方法加id,加table,但是还是报错
解决之后
原来是id的包导入错误了
import javax.persistence.Id;
正确的应该是上面那个。
有跟我一样问题的不明白的可以参考
https://blog.csdn.net/qq_38584262/article/details/85275513
这位作者这几个标签的包列的很清楚的简洁