Repeated column in mapping for entity: com.xxx column: default_store

Posted G_whang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Repeated column in mapping for entity: com.xxx column: default_store相关的知识,希望对你有一定的参考价值。

jpa 扫描实体类创建表的时候报了这个错误:Repeated column in mapping for entity: com.example.easyexceltest.pojo.SvcInfo column: default_store (should be mapped with insert=“false” update=“false”)

Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.example.easyexceltest.pojo.SvcInfo column: default_store (should be mapped with insert="false" update="false")
	at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:862) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:880) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:902) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:634) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.mapping.RootClass.validate(RootClass.java:267) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:354) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1259) ~[hibernate-core-5.4.21.Final.jar:5.4.21.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) ~[spring-orm-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	... 5 common frames omitted

根据提示到实体类中找到 报错字段, 然后发现自己复制粘贴的时候写 @Column 的名称忘记改,导致重复了,就报了这个问题,修改后就正常了

以上是关于Repeated column in mapping for entity: com.xxx column: default_store的主要内容,如果未能解决你的问题,请参考以下文章

Hibernate中的"Repeated column in mapping for entity"异常

org.hibernate.MappingException: Repeated column in mapping for entity: com.boot.entity.RepEntity col

无法启动嵌入式容器;嵌套异常是 java.lang.IllegalArgumentException: Invalid <url-pattern> */ in servlet mappin

961. N-Repeated Element in Size 2N Array

LeetCode 961. N-Repeated Element in Size 2N Array

961. N-Repeated Element in Size 2N Array