net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID

Hibernate JIRA | Yoshitaka Takamura | 1 decade ago
  1. 0

    I have three tables (each has a composite key). I get following message exception during mapping processing. net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID at net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication(AbstractCollectionPersister.java:652) at net.sf.hibernate.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:206) at net.sf.hibernate.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:36) at net.sf.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:55) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:147) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791) SCHEMA DEFINITION ----------------- Table: M_USER - HO_ID (PK) - KA_ID (PK) - NAME Table: M_YEAR - HO_ID (PK) - YEAR_ID (PK) - Q_DATE Table: POINT - HO_ID (PK,FK) - KA_ID (PK,FK) - YEAR_ID (PK,FK) - POINT MAPPING FILE ------------ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping > <class name="test.User" table="M_USER" > <composite-id name="comp_id" class="test.UserPK" > <key-property name="hoId" type="java.lang.String" column="HO_ID" /> <key-property name="kaId" type="java.lang.String" column="KA_ID" /> </composite-id> <property name="name" type="java.lang.String" column="NAME" length="20" /> <map name="points" table="POINT" lazy="false" sort="unsorted" cascade="none" > <key> <column name="HO_ID"/> <column name="KA_ID"/> </key> <index-many-to-many class="test.Year" > <column name="HO_ID"/> <column name="YEAR_ID"/> </index-many-to-many> <composite-element class="test.Point"> <property name="point" type="java.lang.Integer" column="POINT" length="3" /> </composite-element> </map> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Yoshitaka Takamura
    net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID
  2. 0

    I have three tables (each has a composite key). I get following message exception during mapping processing. net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID at net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication(AbstractCollectionPersister.java:652) at net.sf.hibernate.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:206) at net.sf.hibernate.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:36) at net.sf.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:55) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:147) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791) SCHEMA DEFINITION ----------------- Table: M_USER - HO_ID (PK) - KA_ID (PK) - NAME Table: M_YEAR - HO_ID (PK) - YEAR_ID (PK) - Q_DATE Table: POINT - HO_ID (PK,FK) - KA_ID (PK,FK) - YEAR_ID (PK,FK) - POINT MAPPING FILE ------------ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping > <class name="test.User" table="M_USER" > <composite-id name="comp_id" class="test.UserPK" > <key-property name="hoId" type="java.lang.String" column="HO_ID" /> <key-property name="kaId" type="java.lang.String" column="KA_ID" /> </composite-id> <property name="name" type="java.lang.String" column="NAME" length="20" /> <map name="points" table="POINT" lazy="false" sort="unsorted" cascade="none" > <key> <column name="HO_ID"/> <column name="KA_ID"/> </key> <index-many-to-many class="test.Year" > <column name="HO_ID"/> <column name="YEAR_ID"/> </index-many-to-many> <composite-element class="test.Point"> <property name="point" type="java.lang.Integer" column="POINT" length="3" /> </composite-element> </map> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Yoshitaka Takamura
    net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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. net.sf.hibernate.MappingException

      Repeated column in mapping for collection: test.User.points column: HO_ID

      at net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication()
    2. net.sf.hibernate
      Configuration.buildSessionFactory
      1. net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication(AbstractCollectionPersister.java:652)
      2. net.sf.hibernate.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:206)
      3. net.sf.hibernate.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:36)
      4. net.sf.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:55)
      5. net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:147)
      6. net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
      6 frames