org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in class path resource
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]:
Invocation of init method failed; nested exception is org.hibernate.AnnotationException:
No identifier specified for entity: com.example.entity.User
spring data jpa使用注意事项repository应该继承JpaRepository接口,可以使用Spring data jpa自带的方法。entity中对应表的主键字段的属性上应该加上@Id和@GeneratedValue注解,否则会报错,错误信息如下:org.springframework.beans.factory.BeanCrea...