0 Replies Latest reply on Jan 5, 2006 2:00 PM by ansancle

    jbosscmp-jdbc.xml : getting the <foreign-key-mapping/> tag t

    ansancle

      I have searched far and wide to find the answer to this one with no luck. Inside of the jbosscmp-jdbc.xml I need to have the <foreign-key-mapping/> tag inside of my ejb-relation definition. I cannot find anywhere how to have this generated from XDoclet, can anyone tell me the tag?
      Thanks.

      This is an example of my XDoclet Definitions for the relations Im using :

      /**
       * Getter for CMR Relationship
       *
       *
       * @ejb.interface-method view-type="local"
       * @ejb.relation name = "person-to-task"
       * role-name = "task-has-persons"
       * target-multiple = "yes"
       *
       * @jboss.relation related-pk-field = "id"
       * fk-column = "TASK_ID"
       *
       * @ejb.value-object aggregate = "com.digitalhome.interfaces.PersonValue"
       * aggregate-name = "Person"
       * members = "com.digitalhome.interfaces.PersonLocal"
       * members-name = "Persons"
       * relation = "external"
       * type="java.util.Set"
       */
      
      


      And here is the output in jbosscmp-jdbc.xml

       <relationships>
       <ejb-relation>
       <ejb-relation-name>task-comment</ejb-relation-name>
      <!-- THE FOREIGN-KEY-MAPPING TAG NEEDS TO GO HERE! -->
       <ejb-relationship-role>
       <ejb-relationship-role-name>comment-belongs-to-task</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>id</field-name>
       <column-name>TASK_ID</column-name>
       </key-field>
       </key-fields>
      
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>task-has-comments</ejb-relationship-role-name>
       <key-fields/>
      
       </ejb-relationship-role>
       </ejb-relation>
       <ejb-relation>
       <ejb-relation-name>person-to-task</ejb-relation-name>
       <relation-table-mapping>
       </relation-table-mapping>
      
       <ejb-relationship-role>
       <ejb-relationship-role-name>person-has-tasks</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>id</field-name>
       <column-name>TASK_ID</column-name>
       </key-field>
       </key-fields>
      
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>task-has-persons</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>id</field-name>
       <column-name>PERSON_ID</column-name>
       </key-field>
       </key-fields>
      
       </ejb-relationship-role>
       </ejb-relation>
       <!--
       To add jboss relationships for beans not managed by XDoclet, add
       a file to your XDoclet merge directory called jbosscmp-jdbc-relationships.xml that contains
       the <ejb-relation></ejb-relation> markups for those beans.
       -->
       </relationships>