1 Reply Latest reply on Apr 1, 2002 8:14 AM by pazu

    foreign-key mapping in beta1

    ralf.ebert

      Hi,

      I'm using beta 1 currently. I read that there were some changes in the foreign-key mapping in beta 2, but i couldn't find any hints on changes from alpha to beta 1. But the files working with jBoss alpha don't work with beta 1 - he just take the default name for the foreign-key mapping fields. How can I change that behaviour in beta 1 ?

      Here an example from my jboss-jdbc.xml:

      <!-- <ejb-relation>
      <ejb-relation-name>Event-Auftrag</ejb-relation-name>
      <foreign-key-mapping>

      <ejb-relationship-role>
      <ejb-relationship-role-name>auftrag-hat-events</ejb-relationship-role-name>
      <fk-constraint>false</fk-constraint>
      <foreign-key-fields/>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>events-haben-auftrag</ejb-relationship-role-name>
      <fk-constraint>false</fk-constraint>
      <foreign-key-fields>
      <foreign-key-field>
      <field-name>Anr</field-name>
      <column-name>anr</column-name>
      </foreign-key-field>
      </foreign-key-fields>
      </ejb-relationship-role>

      </foreign-key-mapping>
      </ejb-relation>

      Thanks in advance,
      Regards Ralf

        • 1. Re: foreign-key mapping in beta1
          pazu

          Ralf, the DTD has changed substantially between alpha and beta2. Please, read the new DTD, it sould be in the distribution. Anyway, your mapping should be like this:
          [pre]
          <ejb-relation>
          <ejb-relation-name>Event-Auftrag</ejb-relation-name>
          <foreign-key-mapping/>
          <ejb-relationship-role>
          <ejb-relationship-role-name>auftrag-hat-events</ejb-relationship-role-name>
          <fk-constraint>false</fk-constraint>
          <key-fields>
          <key-field>
          <field-name>Anr</field-name>
          <column-name>anr</column-name>
          </key-field>
          </key-fields>
          </ejb-relationship-role>
          <ejb-relationship-role>
          <ejb-relationship-role-name>events-haben-auftrag</ebj-relationship-role-name>
          <fk-constraint>false</fk-constraint>
          <key-fields/>
          </ejb-relationship-role>
          </ejb-relation>
          [/pre]