如果jpa项目中有两个不同包下拥有相同的实体类,且都标记了@Entity注解,会报如下异常,解决方案就是在@entity(name="xxx")添加name属性
Caused by: org.hibernate.DuplicateMappingException: The [io.qiuguo.modules.business.user.entity.User]
and [io.qiuguo.modules.relationship.many2many.User]
entities share the same JPA entity name: [User] which is not allowed!
springdatajpa使用@Entity异常
最新推荐文章于 2023-06-01 14:58:40 发布