1 Reply Latest reply on Feb 1, 2005 6:19 AM by Alexey Loubyansky

    FK constraits doesn't work in 4.0.1

    Mic Mac Newbie

      Hello!

      I have CMP entity beans with CMR relations, example:
      Mandator 1 ----- * Description

      My ejb-jar.xml
      <ejb-relation >
      <ejb-relation-name>mandator-mandatorDescription</ejb-relation-name>
      <ejb-relationship-role > <ejb-relationship-role-name>description-belongs-to-mandator</ejb-relationship-role-name>
      Many
      <cascade-delete/>
      <relationship-role-source >
      <ejb-name>MandatorDescription</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>mandator</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role > <ejb-relationship-role-name>mandator-has-descriptions</ejb-relationship-role-name>
      One
      <relationship-role-source >
      <ejb-name>Mandator</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>descriptions</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>

      My jbosscmp-jdbc.xml
      <ejb-relation>
      <ejb-relation-name>mandator-mandatorDescription</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>
      description-belongs-to-mandator
      </ejb-relationship-role-name>
      <key-fields/>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>
      mandator-has-descriptions
      </ejb-relationship-role-name>
      <fk-constraint>
      true
      </fk-constraint>
      <key-fields>
      <key-field>
      <field-name>
      id
      </field-name>
      <column-name>
      MAND_MAN_ID
      </column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      </ejb-relation>

      A fc constraint should be created on the MAND_MAN_ID column in the MANDATOR table. In JBoss version 3.2.3 it works fine. I try to switch to version 4.0.1 but with this version fk constraints are not created. I use MySQL, in both cases the same version. Can anyone help me with this problem?

      Best Regards
      Michael