我最近开始看到JDO错误,例如
Class X has been specified with an object-id class javax.jdo.identity.StringIdentity yet no fields have been identified as primary key fields.
我的课程正在使用javax.persistence.Id
注释,例如:
@Id
final private String key;
答案 0 :(得分:1)
事实证明,这是由于将关键字段标记为最终字段。要修复,只需将声明更改为以下内容:
@Id
private String key;
为了后代的利益离开这里!