项目中出现org.hibernate.AnnotationException: No identifier specified for entity 错误
解决办法:第一种:.看是否加@ID注解
第二种:正确的应该是import javax.persistence.Id 而我却导入了org.springframework.data.annotation.Id 这样虽然@Id 在IDE语法检查时不会报错,但并不是我们本来想要的那个功能,因此运行时会报上面但错误。
项目中出现org.hibernate.AnnotationException: No identifier specified for entity 错误
解决办法:第一种:.看是否加@ID注解
第二种:正确的应该是import javax.persistence.Id 而我却导入了org.springframework.data.annotation.Id 这样虽然@Id 在IDE语法检查时不会报错,但并不是我们本来想要的那个功能,因此运行时会报上面但错误。