-->
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.  [ 6 posts ] 
Author Message
 Post subject: org.hibernate.DuplicateMappingException
PostPosted: Fri Jun 02, 2006 4:59 pm 
Newbie

Joined: Fri Jun 02, 2006 4:56 pm
Posts: 3
Could someone tell me the reason why we would get this exception "org.hibernate.DuplicateMappingException: Duplicate collection role mapping"

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.elemica.api.component.account.AccountBean.accountBusinessRules
org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.elemica.api.component.account.AccountBean.accountBusinessRules


Thanks
Sam


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 5:15 pm 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
post the mapping files


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 5:21 pm 
Newbie

Joined: Fri Jun 02, 2006 4:56 pm
Posts: 3
AccountBean.hbm.xml
--------------------------

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class
name="com.elemica.api.component.account.AccountBean"
table="ACCOUNT"
schema="ELEMWSDEV"
>
<id
name="accountId"
type="long"
column="ACCOUNT_ID"
length="10"
>
<generator class="native">
<param name="sequence">ACCOUNT_ID</param>
</generator>
</id>
<property
name="accountName"
type="string"
column="ACCOUNT_NAME"
not-null="true"
length="256"
/>
<property
name="createdBy"
type="long"
column="CREATED_BY"
not-null="true"
length="38"
/>
<property
name="dateCreated"
type="timestamp"
column="DATE_CREATED"
not-null="true"
length="7"
/>
<property
name="statusId"
type="long"
column="STATUS_ID"
not-null="true"
length="22"
/>

<!-- Associations -->
<!-- bi-directional many-to-one association to AccountRoleTypeBean -->
<many-to-one
name="accountRoleType"
class="com.elemica.api.component.account.AccountRoleTypeBean"
cascade="none"
>
<column name="ROLE_TYPE" />
</many-to-one>
<!-- bi-directional many-to-one association to AccountBusinessRuleBean -->
<set
name="accountBusinessRules"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUNT_BUSINESS_RULES referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountBusinessRuleBean" />
</set>
<!-- bi-directional many-to-one association to AccountRelationshipBean -->
<set
name="accountRelationships"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUNT_RELATIONSHIP referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountRelationshipBean" />
</set>
<!-- bi-directional many-to-one association to AccountRelationshipBean -->
<set
name="accountReports"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUNT_REPORTS referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountReportBean" />
</set>
<!-- bi-directional many-to-one association to AccountRoleTypeBean -->
<set
name="accountRoleTypes"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ROLE_TYPE" /> <!-- a foreign key in ACCOUNT_ROLE_TYPE referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountRoleTypeBean" />
</set>
<!-- bi-directional many-to-one association to AccountRoutingBean -->
<set
name="accountRoutings"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUNT_ROUTING referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountRoutingBean" />
</set>
<!-- bi-directional many-to-one association to AccountXrefBean -->
<set
name="accountXrefs"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUNT_XREF referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccountXrefBean" />
</set>
<!-- bi-directional many-to-one association to AccoutMsgProcessingBean -->
<set
name="accoutMsgProcessings"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="ACCOUNT_ID" /> <!-- a foreign key in ACCOUT_MSG_PROCESSING referencing the primary key of this table. -->
</key>
<one-to-many class="com.elemica.api.component.account.AccoutMsgProcessingBean" />
</set>



</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 5:37 pm 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
post AccountBusinessRuleBean map file


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 5:40 pm 
Newbie

Joined: Fri Jun 02, 2006 4:56 pm
Posts: 3
AccountBusinessRuleBean.hbm.xml
-----------------------------------------
Code:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class
    name="com.elemica.api.component.account.AccountBusinessRuleBean"
    table="ACCOUNT_BUSINESS_RULES"
    schema="ELEMWSDEV"
>
    <id
        name="acctBrId"
        type="long"
        column="ACCT_BR_ID"
        length="10"
    >
        <generator class="native">
            <param name="sequence">ACCT_BR_ID</param>
        </generator>
    </id>
    <property
        name="businessRuleId"
        type="long"
        column="BUSINESS_RULE_ID"
        not-null="true"
        length="10"
    />
    <property
        name="createdBy"
        type="long"
        column="CREATED_BY"
        not-null="true"
        length="38"
    />
    <property
        name="dateCreated"
        type="timestamp"
        column="DATE_CREATED"
        not-null="true"
        length="7"
    />
    <property
        name="dateModified"
        type="timestamp"
        column="DATE_MODIFIED"
        length="7"
    />
    <property
        name="modifiedBy"
        type="long"
        column="MODIFIED_BY"
        length="38"
    />
    <property
        name="statusId"
        type="long"
        column="STATUS_ID"
        not-null="true"
        length="10"
    />

    <!-- Associations -->
    <!-- bi-directional many-to-one association to AccountBean -->
    <many-to-one
        name="account"
        class="com.elemica.api.component.account.AccountBean"
        cascade="none"
    >
        <column name="ACCOUNT_ID" />
    </many-to-one>

</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 05, 2006 3:11 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
Do you have any kind of inheritance in your pojos?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.