解决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”)

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