spring data出现creating bean with name entityManagerFactory的原因

关于使用spring data jpa出现的问题。
错误提示:org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.wangyu.sell.domain.ProductCategory

出现错误的原因是我没有在domain里面设置主键,设置主键就好了

你可能感兴趣的:(spring的错误)