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下的包,如下的导入是造成错误的原因。

把上面的代码删除即可。

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