解決Error creating bean with name entityManagerFactory defined in class path resource org/spring...

問題:

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.DuplicateMappingException: The [com.ihrm.domain.atte.entity.CompanySettings] and [com.ihrm.domain.social_security.CompanySettings] entities share the same JPA entity name: [CompanySettings] which is not allowed!

說明:

兩個應用模塊的數據模型類名稱重複了。

解決:

兩個實體類的@Entity註解加上name屬性。

@Entity(name = “atte_company_settings”)
@Entity(name = “ss_company_settings”)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章