nested exception is org.hibernate.AnnotationException: No identifier specified for entity報錯

Invocation of init method failed; nested exception is 
org.hibernate.AnnotationException: No identifier specified for entity:

新添加了一個實體類,報以上錯誤。原因是我添加的@Id註解導入的包有誤,

 

@Id不用導入spring下的包,如下的導入是造成錯誤的原因。

把上面的代碼刪除即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章