0 Replies Latest reply on Jul 30, 2003 9:17 AM by ansarim

    Problem with CMR...

    ansarim Newbie

      hi,
      i have a problem of "duplicated column" when i try to insert a new record in a table...
      I have this error when i'm using CMR.
      I have a one-2-many relationship between two tables : Register and Equip_type

      CMR field abstract accessors for RegisterBean.java :
      public abstract Equip_typeLocal getEquipType();
      public abstract void setEquipType(Equip_typeLocal equiptype);

      CMR field abstract accessors for Equip_typeBean.java :
      public abstract java.util.Set getRegisters();
      public abstract void setRegisters(java.util.Set registers);

      my ejb-jar.xml
      (...)

      <ejb-relation>
      <ejb-relation-name>Equip_type - Register</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Equip_type may have many Register</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>Equip_type</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>registers</cmr-field-name>
      <cmr-field-type>java.util.Set</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Register may have one Equip_type</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>Register</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>equiptype</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>


      the jbosscmp-jdbc.xml
      (...)

      <ejb-relation>
      <ejb-relation-name>Equip_type - Register</ejb-relation-name>
      <foreign-key-mapping />
      <ejb-relationship-role>
      <ejb-relationship-role-name>Equip_type may have many Register</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>cd_equip_type</field-name>
      <column-name>cd_equip_type</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Register may have one Equip_type</ejb-relationship-role-name>
      <key-fields />
      </ejb-relationship-role>
      </ejb-relation>


      do u see any errors ?

      thanks a lot