org.hibernate.MappingException: Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false")

Hibernate JIRA | David Balažic | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    (verbatim from the forum , http://forum.hibernate.org/viewtopic.php?t=967007 ) Hi! I use hbm2ddl (from Hibernate Tools v3.2 beta 8) to create the DB schema and noticed, that duplicate column names are not detected. Example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.manning.hq.stein.data"> <class name="TelefonskiImenik"> <id name="id" column="imid"> <generator class="native" /> </id> <property name="izdajatelj" column="col"/> <property name="verzija" column="col"/> </class> </hibernate-mapping> The same thing happens if one column name is implicit : <property name="izdajatelj" column="verzija"/> <property name="verzija"/> If I try to use this mapping with an application, hibernate (v3.2) fails (in both cases) in buildSessionFactory() : Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false") at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:605) at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:627) at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:645) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:420) at org.hibernate.mapping.RootClass.validate(RootClass.java:192) at org.hibernate.cfg.Configuration.validate(Configuration.java:1026) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211) at com.manning.hq.stein.Main2.persist_all(Main2.java:284) at com.manning.hq.stein.Main2.main(Main2.java:45) While this is not a severe bug, it would be nice to detect it as early as possible.

    Hibernate JIRA | 1 decade ago | David Balažic
    org.hibernate.MappingException: Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false")
  2. 0

    (verbatim from the forum , http://forum.hibernate.org/viewtopic.php?t=967007 ) Hi! I use hbm2ddl (from Hibernate Tools v3.2 beta 8) to create the DB schema and noticed, that duplicate column names are not detected. Example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.manning.hq.stein.data"> <class name="TelefonskiImenik"> <id name="id" column="imid"> <generator class="native" /> </id> <property name="izdajatelj" column="col"/> <property name="verzija" column="col"/> </class> </hibernate-mapping> The same thing happens if one column name is implicit : <property name="izdajatelj" column="verzija"/> <property name="verzija"/> If I try to use this mapping with an application, hibernate (v3.2) fails (in both cases) in buildSessionFactory() : Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false") at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:605) at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:627) at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:645) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:420) at org.hibernate.mapping.RootClass.validate(RootClass.java:192) at org.hibernate.cfg.Configuration.validate(Configuration.java:1026) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211) at com.manning.hq.stein.Main2.persist_all(Main2.java:284) at com.manning.hq.stein.Main2.main(Main2.java:45) While this is not a severe bug, it would be nice to detect it as early as possible.

    Hibernate JIRA | 1 decade ago | David Balažic
    org.hibernate.MappingException: Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false")
  3. 0

    Unable to instantiate custom type error in Hibernate mapping Enum mapping

    Stack Overflow | 4 years ago | Johnny
    org.hibernate.MappingException: Unable to instantiate custom type: org.hibernate.type.EnumType
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate mapping. Table related with other two

    Stack Overflow | 1 year ago | Rob
    org.hibernate.MappingException: An association from the table A refers to an unmapped class: Shortcut
  6. 0

    how to insert values in database using Hibernate in dynamic web project

    Stack Overflow | 2 years ago | Vishnu Ranganathan
    org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(email)]

  1. kuldeep 16 times, last 6 months ago
  2. esaar 1 times, last 8 months ago
  3. r1chjames 1 times, last 9 months ago
  4. Kawada 6 times, last 10 months ago
  5. Harsh 1 times, last 11 months ago
34 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.MappingException

    Repeated column in mapping for entity: com.manning.hq.stein.data.TelefonskiImenik column: verzija (should be mapped with insert="false" update="false")

    at org.hibernate.mapping.PersistentClass.checkColumnDuplication()
  2. Hibernate
    Configuration.buildSessionFactory
    1. org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:605)
    2. org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:627)
    3. org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:645)
    4. org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:420)
    5. org.hibernate.mapping.RootClass.validate(RootClass.java:192)
    6. org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
    7. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
    7 frames
  3. com.manning.hq
    Main2.main
    1. com.manning.hq.stein.Main2.persist_all(Main2.java:284)
    2. com.manning.hq.stein.Main2.main(Main2.java:45)
    2 frames