Caused by: org.hibernate.AnnotationException: No identifier specified for entity:
程序员文章站
2022-04-12 16:24:56
...
项目报错如下:
Caused by: org.hibernate.AnnotationException: No identifier specified for entity:
原因是没有加@Id注解,但是我发现我的字段上是加了的。最后发现引入的包不对。
错误的包:
import org.springframework.data.annotation.Id;
正确的包:
import javax.persistence.*;
上一篇: ERROR 1136 (21S01): Column count doesn't match value count at row 1
下一篇: ERROR 1136 (21S01): Column count doesn't match value count at row 1
推荐阅读
-
错误org.hibernate.AnnotationException: No identifier specified for entity
-
JPA 异常: Caused by: org.hibernate.AnnotationException: No identifier specified for entity
-
Caused by: org.hibernate.AnnotationException: No identifier specified for entity
-
Caused by: org.hibernate.AnnotationException: No identifier specified for en . . . . .
-
Caused by: org.hibernate.AnnotationException: No identifier specified for entity
-
Caused by: org.hibernate.AnnotationException: No identifier specified for entity:
-
Caused by: org.hibernate.AnnotationException: No identifier specified for en . . . . .