Hi All, I am trying to persist a many -to-many relationship between location and department in a join table called as LOCATION_DEPARTMENT. The Primary key for Location is location_id and employer_code and the primary key for Department is department_id and employer_code. I am getting "DUPLICATE COLUMN EXCEPTION "as the container is trying to insert EMPLOYER_CODE twice. Can anyone help.
My jbosscmp-jdbc has the following relationship block: <ejb-relation> <ejb-relation-name>Location_Department</ejb-relation-name> <relation-table-mapping> <table-name>LOCATION_DEPARTMENT</table-name> </relation-table-mapping> <ejb-relationship-role> <ejb-relationship-role-name>Location-has-many-Departments</ejb-relationship- role-name> <fk-constraint>false</fk-constraint> <key-fields> <key-field> <field-name>locationID</field-name> <column-name>LOCATION_ID</column-name> </key-field> <key-field> <field-name>employerID</field-name> <column-name>EMPLOYER_CODE</column-name> </key-field> </key-fields> </ejb-relationship-role> <ejb-relationship-role> <ejb-relationship-role-name>Department-has-many-Locations</ejb-relationship- role-name> <fk-constraint>false</fk-constraint> <key-fields> <key-field> <field-name>departmentID</field-name> <column-name>DEPARTMENT_ID</column-name> </key-field> <key-field> <field-name>employerID</field-name> <column-name>EMPLOYER_CODE</column-name> </key-field> </key-fields> </ejb-relationship-role> </ejb-relation> Regards, Preeti ------------------------------------------------------- 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