-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: many-to-many mapping produces "repeated column in mappi
PostPosted: Tue Dec 14, 2004 9:01 am 
Beginner
Beginner

Joined: Wed Dec 08, 2004 9:17 am
Posts: 25
Hi there,

I have no more ideas what to try, so any help is greatly appreciated.

I have the following two mappings with a many to many mapping. When building the session factory I get a "net.sf.hibernate.MappingException: Repeated column in mapping for collection: de.vodafone.rnp.core.business.Cell.cellgroups column: arb_lfdnr" exception. Any ideas what I am doing wrong?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping SYSTEM "file:/home/tesd/okuntze/develop/jstovplami_springhibernate/config/hibernate-mapping-2.0.dtd">
<hibernate-mapping schema="dbo" package="de.vodafone.rnp.core.business">
<class name="Cell" table="funzel" proxy="Cell">
<composite-id>
<key-property name="workspaceId"/>
<key-property name="versionId"/>
<key-property name="regionId"/>
<key-property name="cellCompoundCode"/>
<key-property name="siteId"/>
<key-property name="alternativeId"/>
<key-property name="radioSystemId"/>
<key-property name="id"/>
</composite-id>
<property name="workspaceId" type="integer" column="arb_lfdnr"/>
<property name="versionId" type="integer" column="ver_nr"/>
<property name="regionId" type="character" column="nls_id"/>
<property name="cellCompoundCode" type="string" column="sta_id"/>
<property name="siteId" type="character" column="sta_loc"/>
<property name="alternativeId" type="integer" column="alt_nr"/>
<property name="radioSystemId" type="integer" column="fan_lfdnr"/>
<property name="id" type="character" column="zel_id"/>
<property name="networkSystemLabel" type="character" column="zel_freq_band"/>
<property name="tlossCorrection" type="double" column="zel_korr_t_loss"/>
<property name="cableLength" type="integer" column="zel_kabel_lg"/>
<property name="pilotPower" type="double" column="zel_power_bcch"/>

<set name="cellgroups" table="funzgm" lazy="true">
<key>
<column name="arb_lfdnr"/>
<column name="ver_nr"/>
<column name="nls_id"/>
<column name="sta_id"/>
<column name="sta_loc"/>
<column name="alt_nr"/>
<column name="fan_lfdnr"/>
<column name="zel_id"/>
</key>
<many-to-many class="CellGroup">
<column name="arb_lfdnr"/>
<column name="ver_nr"/>
<column name="zgr_id"/>
</many-to-many>
</set>
<!--subclass name="de.vodafone.rnp.core.business.persistence.jdo.CellImpl"/-->
</class>
</hibernate-mapping>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping SYSTEM "file:/home/tesd/okuntze/develop/jstovplami_springhibernate/config/hibernate-mapping-2.0.dtd">
<hibernate-mapping schema="dbo" package="de.vodafone.rnp.core.business">
<class name="CellGroup" table="funzgr" proxy="CellGroup">
<composite-id>
<key-property name="workspaceId"/>
<key-property name="versionId"/>
<key-property name="name"/>
</composite-id>
<property name="workspaceId" type="integer" column="arb_lfdnr" insert="false" update="false"/>
<property name="versionId" type="integer" column="ver_nr" insert="false" update="false"/>
<property name="name" type="string" column="zgr_id"/>

<set name="cells" table="funzgm" lazy="true" inverse="true">
<key>
<column name="arb_lfdnr"/>
<column name="ver_nr"/>
<column name="zgr_id"/>
</key>
<many-to-many class="Cell">
<column name="arb_lfdnr"/>
<column name="ver_nr"/>
<column name="nls_id"/>
<column name="sta_id"/>
<column name="sta_loc"/>
<column name="alt_nr"/>
<column name="fan_lfdnr"/>
<column name="zel_id"/>
</many-to-many>
</set>
<many-to-one name="version" class="Version">
<column name="arb_lfdnr"/>
<column name="ver_nr"/>
</many-to-one>
<!--subclass name="de.vodafone.rnp.core.business.persistence.jdo.CellGroupImpl"/-->
</class>
</hibernate-mapping>

Hibernate version:
2.1.7
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
net.sf.hibernate.MappingException: Repeated column in mapping for collection: de.vodafone.rnp.core.business.Cell.cellgroups column: arb_lfdnr
at net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication(AbstractCollectionPersister.java:654)
at net.sf.hibernate.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:167)
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:148)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:796)
Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 9:57 am 
Beginner
Beginner

Joined: Wed Dec 08, 2004 9:17 am
Posts: 25
Just in case another newbie is running into the same problems, here is how the mappings should have looked like from the beginning...
;-)

Code:
<hibernate-mapping schema="dbo" package="de.vodafone.rnp.core.business.persistence.hibernate">
    <class name="CellImpl" table="funzel" proxy="CellImpl" lazy="true">
        <composite-id>
            <key-property name="workspaceId" type="integer" column="arb_lfdnr"/>
            <key-property name="versionId" type="integer" column="ver_nr"/>
            <key-property name="regionId" type="character" column="nls_id"/>
            <key-property name="cellCompoundCode" type="string" column="sta_id"/>
            <key-property name="siteId" type="character" column="sta_loc"/>
            <key-property name="alternativeId" type="integer" column="alt_nr"/>
            <key-property name="radioSystemId" type="integer" column="fan_lfdnr"/>
            <key-property name="id" type="character" column="zel_id"/>
        </composite-id>
        <property name="networkSystemLabel" type="character" column="zel_freq_band"/>
        <property name="tlossCorrection" type="double" column="zel_korr_t_loss"/>
        <property name="cableLength" type="integer" column="zel_kabel_lg"/>
        <property name="pilotPower" type="double" column="zel_power_bcch"/>
       
        <set name="cellgroups" table="vsto_funzgm" lazy="true">
            <key>
                <column name="arb_lfdnr_2"/>
                <column name="ver_nr_2"/>
                <column name="nls_id"/>
                <column name="sta_id"/>
                <column name="sta_loc"/>
                <column name="alt_nr"/>
                <column name="fan_lfdnr"/>
                <column name="zel_id"/>
            </key>
            <many-to-many class="CellGroupImpl">
                <column name="arb_lfdnr_1"/>
                <column name="ver_nr_1"/>
                <column name="zgr_id"/>
            </many-to-many>
        </set>
    </class>
</hibernate-mapping>


Code:
<hibernate-mapping schema="dbo" package="de.vodafone.rnp.core.business.persistence.hibernate">
    <class name="CellGroupImpl" table="funzgr" proxy="CellGroupImpl" lazy="true">
        <composite-id>
            <key-property name="workspaceId" type="integer" column="arb_lfdnr"/>
            <key-property name="versionId" type="integer" column="ver_nr"/>
            <key-property name="name" type="string" column="zgr_id"/>
        </composite-id>
        <set name="cells" table="vsto_funzgm" lazy="true" inverse="true">
            <key>
                <column name="arb_lfdnr_1"/>
                <column name="ver_nr_1"/>
                <column name="zgr_id"/>
            </key>
            <many-to-many class="CellImpl">
                <column name="arb_lfdnr_2"/>
                <column name="ver_nr_2"/>
                <column name="nls_id"/>
                <column name="sta_id"/>
                <column name="sta_loc"/>
                <column name="alt_nr"/>
                <column name="fan_lfdnr"/>
                <column name="zel_id"/>
            </many-to-many>
        </set>
        <many-to-one name="version" class="VersionImpl" insert="false" update="false">
            <column name="arb_lfdnr"/>
            <column name="ver_nr"/>
        </many-to-one>
    </class>
</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.