错误org.hibernate.AnnotationException: No identifier specified for entity
程序员文章站
2022-04-12 17:45:31
...
org.hibernate.AnnotationException: No identifier specified for entity
报这个异常的原因是因为JavaBeam的主键没有注解映射关系
解决方案如下:
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="ID", unique=true, nullable=false, insertable=true, updatable=false, precision=20, scale=0)
或者
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "sequence",
parameters = { @Parameter(name = "sequence", value = "TEST_SEQ") })
推荐阅读
-
错误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 . . . . .