Caused by: org.hibernate.AnnotationException: No identifier specified fo

来源:互联网 发布:wwe2k16优化 编辑:程序博客网 时间:2024/05/23 10:39



实体映射oracle数据库表,启动服务时包错误信息:Caused by: org.hibernate.AnnotationException: No identifier specified fo

我设计的实体从需求上不需要主键,但是这是Hinbernate的规范,只能强行增加ID字段了。

增加ID字段并加上注解如:

        @Id@GeneratedValue(generator = "system-uuid")@GenericGenerator(name = "system-uuid", strategy = "uuid")private String id;


0 0