Spring data jpa 报错 org.hibernate.AnnotationException: No identifier specified for entity: com.trs.id

用上篇文档的idea自动生成数据库实体类后,在启动项目的时候报错.如下:

org.hibernate.AnnotationException: No identifier specified for entity: com.trs.idap.domain.entity.greenplum.TrsActionCarInfo

Spring data jpa 报错 org.hibernate.AnnotationException: No identifier specified for entity: com.trs.id

仔细看来下,原来是在生成实体类的时候,没有选在使用主键注解.所以在项目的主键上面加上主键注解,是完全没有问题...

Spring data jpa 报错 org.hibernate.AnnotationException: No identifier specified for entity: com.trs.id

 

这样就完全可以启动,完全ojbk.......