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

Posted 谢世林

tags:

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

Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.boot.entity.RepEntity column: rep_batch (should be mapped with insert="false" update="false")
	at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:862) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:880) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:902) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:634) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.mapping.RootClass.validate(RootClass.java:267) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:343) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:461) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) ~[hibernate-core-5.4.3.Final.jar:5.4.3.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.1.4.RELEASE.jar:5.1.4.RELEASE]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.4.RELEASE.jar:5.1.4.RELEASE]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.4.RELEASE.jar:5.1.4.RELEASE]
	... 25 common frames omitted

  

  报错原因:spring映射重名,改正之后就OK了。只是记录本人出现此问题

 

  

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