Hi
everyone,
I got the following
error at hibernate version 2.0.3 and I have no idea what does it
mean??
net.sf.hibernate.MappingException: Repeated column in
mapping for collection: com.accucast4.testcase5.Customer.recipients column:
RC_C_ID
at net.sf.hibernate.collection.CollectionPersister.checkColumnDuplication(CollectionPersister.java:838)
at net.sf.hibernate.collection.CollectionPersister.<init>(CollectionPersister.java:214)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.addSessionManagementHolder(CustomerDataSourceConfigurationFactory.java:62)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.retrieveDataSourceCfgHolder(CustomerDataSourceConfigurationFactory.java:85)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.getSession(CustomerDataSourceConfigurationFactory.java:107)
at com.accucast3.kernel.test.TestCustomerDataSourceConfiguration.getSession(TestCustomerDataSourceConfiguration.java:32)
at com.accucast3.kernel.Kernel.getSession(Kernel.java:62)
at com.accucast3.kernel.Kernel.main(Kernel.java:75)
at net.sf.hibernate.collection.CollectionPersister.checkColumnDuplication(CollectionPersister.java:838)
at net.sf.hibernate.collection.CollectionPersister.<init>(CollectionPersister.java:214)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.addSessionManagementHolder(CustomerDataSourceConfigurationFactory.java:62)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.retrieveDataSourceCfgHolder(CustomerDataSourceConfigurationFactory.java:85)
at com.accucast4.customerdatasource.CustomerDataSourceConfigurationFactory.getSession(CustomerDataSourceConfigurationFactory.java:107)
at com.accucast3.kernel.test.TestCustomerDataSourceConfiguration.getSession(TestCustomerDataSourceConfiguration.java:32)
at com.accucast3.kernel.Kernel.getSession(Kernel.java:62)
at com.accucast3.kernel.Kernel.main(Kernel.java:75)
Does anyone have any
idea?? Here is the customer mapping file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<class
name="com.accucast4.testcase5.Customer"
table="CUSTOMER"
>
<id
name="custId"
type="long"
column="CUST_ID"
>
<generator class="assigned" />
</id>
<property
name="firstName"
type="java.lang.String"
column="FIRST_NAME"
length="20"
/>
name="com.accucast4.testcase5.Customer"
table="CUSTOMER"
>
<id
name="custId"
type="long"
column="CUST_ID"
>
<generator class="assigned" />
</id>
<property
name="firstName"
type="java.lang.String"
column="FIRST_NAME"
length="20"
/>
<!-- bi-directional
one-to-many association to Recipient -->
<map
name="recipients"
lazy="true"
inverse="true"
cascade="all"
>
<key>
<column name="RC_C_ID" />
</key>
<composite-index class="com.accucast4.testcase5.RecipientPK">
<key-property name="rcDId" type="long" column="RC_D_ID" />
<key-property name="rcCId" type="long" column="RC_C_ID" />
</composite-index>
<one-to-many
class="com.accucast4.testcase5.Recipient"
/>
</map>
<map
name="recipients"
lazy="true"
inverse="true"
cascade="all"
>
<key>
<column name="RC_C_ID" />
</key>
<composite-index class="com.accucast4.testcase5.RecipientPK">
<key-property name="rcDId" type="long" column="RC_D_ID" />
<key-property name="rcCId" type="long" column="RC_C_ID" />
</composite-index>
<one-to-many
class="com.accucast4.testcase5.Recipient"
/>
</map>
</class>
</hibernate-mapping>
</hibernate-mapping>
Thanks..
Vivian Fonger
Software Engineer
Socketware