問題:
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”)