错误: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.xiaoleng.xltourismxkh.entity.TourColumn
解决办法:
1.看看注解写全没
2.实体类中必须得有id 得用@id 在Hibernate中必须要有一个条件来区分两条数据的不同,而在数据库中主键刚好起到这个作用,如果不想要一个额外的列来做主键,你可以把你现有的字段(比如人员编号)做为主键