SpringBoot 2.0 +JPA 啟動報錯
1靴姿、原因:實體字段中有某個屬性是Object類型的,則啟動報錯磁滚!
2佛吓、常見其他錯誤,導(dǎo)錯包垂攘。
3维雇、駝峰表示沒有轉(zhuǎn)為下劃線表示
4、應(yīng)該導(dǎo)的包????import javax.persistence.*;
Exception encountered during context initialization - cancelling refresh attempt: 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: property mapping has wrong number of columns: com.arc.model.enviroment.ProjectEnvironment.sourcePrimary type: object
翻譯
在上下文初始化期間遇到異常 - 取消刷新嘗試:org.springframework.beans.factory.BeanCreationException:在類路徑資源中定義名稱為'entityManagerFactory'的bean時出錯[org / springframework / boot / autoconfigure / orm / jpa / HibernateJpaConfiguration.class] :調(diào)用init方法失敗; 嵌套異常是javax.persistence.PersistenceException:[PersistenceUnit:default]無法構(gòu)建Hibernate SessionFactory; 嵌套異常是org.hibernate.MappingException:屬性映射列數(shù)錯誤:com.arc.model.enviroment.ProjectEnvironment.sourcePrimary類型:object