Hello Preeti, rename one EMPLOYER_CODE to something else. It will work.
alex Saturday, September 28, 2002, 1:36:26 PM, you wrote: Ps> Hi All, Ps> I am trying to persist a many -to-many relationship between location and Ps> department in a join table called as LOCATION_DEPARTMENT. Ps> The Primary key for Location is location_id and employer_code and the Ps> primary key for Department is department_id and employer_code. Ps> I am getting Ps> "DUPLICATE COLUMN EXCEPTION "as the container is trying to insert Ps> EMPLOYER_CODE twice. Ps> Can anyone help. Ps> My jbosscmp-jdbc has the following relationship block: Ps> <ejb-relation> Ps> <ejb-relation-name>Location_Department</ejb-relation-name> Ps> <relation-table-mapping> Ps> <table-name>LOCATION_DEPARTMENT</table-name> Ps> </relation-table-mapping> Ps> <ejb-relationship-role> Ps> <ejb-relationship-role-name>Location-has-many-Departments</ejb-relationship- role-name>> Ps> <fk-constraint>false</fk-constraint> Ps> <key-fields> Ps> <key-field> Ps> <field-name>locationID</field-name> Ps> <column-name>LOCATION_ID</column-name> Ps> </key-field> Ps> <key-field> Ps> <field-name>employerID</field-name> Ps> <column-name>EMPLOYER_CODE</column-name> Ps> </key-field> Ps> </key-fields> Ps> </ejb-relationship-role> Ps> <ejb-relationship-role> Ps> <ejb-relationship-role-name>Department-has-many-Locations</ejb-relationship- role-name>> Ps> <fk-constraint>false</fk-constraint> Ps> <key-fields> Ps> <key-field> Ps> <field-name>departmentID</field-name> Ps> <column-name>DEPARTMENT_ID</column-name> Ps> </key-field> Ps> <key-field> Ps> <field-name>employerID</field-name> Ps> <column-name>EMPLOYER_CODE</column-name> Ps> </key-field> Ps> </key-fields> Ps> </ejb-relationship-role> Ps> </ejb-relation> Ps> Regards, Ps> Preeti -- Best regards, Alex Loubyansky ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user