[eclipse常见问题]The entity has no primary key attribute defined

原因:实体类继承了ID,但是ID没有被映射到。
在此java类中加入@ID方法,会报错,会重复。
解决办法:
Windows->Persistence->Java Persistence->JPA->Errors/Warnings->Type, 将“Entity has no primary key”设为警告或更低的提示级别。

猜你喜欢

转载自blog.csdn.net/qq_35835118/article/details/83505399