问题描述:
ERROR org.springframework.boot.SpringApplication - Application startup failed 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: mappedBy reference an unknown target entity property:
解决方法:
这个问题主要是实体类与数据库表映射问题,主要问题出在实体类中:
1、检查变量名与数据库表中是否对应;
2、检查@Column()是否写错;
3、检查是否写了@Entity、@Id;
主要就是仔细检查、认真检查!!!