8 Replies Latest reply on Oct 20, 2004 6:25 AM by Pablo Javier Santa Cruz Cosp

    incomplete jbosscmp-jdbc.xml generated using xdoclet+jboss

    Sudhir Srinivas Newbie

      I created a 1:m relation between two beans as follows:

      /**
      *@ejb.relation
      * name="FolderMayContainDevices"
      * role-name="FolderToDevices"
      * target-ejb="Device"
      * target-multiple="yes"
      * target-role-name="DeviceToFolder"
      *
      *@jboss.relation
      * related-pk-field="id”
      * fk-column="folderId”
      *
      *@ejb.interface-method
      *
      */
      public abstract Collection getDevices(Integer folderId);

      I get deployment error like this:

      org.jboss.deployment.DeploymentException: Atleast one role of a foreign-key mapped relationship must have key fields (or <primkey-field> is missing from ejb-jar.xml): ejb-relation-name=FolderMayContainDevices

      And I notice in jbosscmp-jdbc.xml that key-fields are empty. Are we missing any attribute in ant task?



      <ejb-relation>
      <ejb-relation-name>FolderMayContainDevices</ejb-relation-name>
      <relation-table-mapping>
      </relation-table-mapping>

      <ejb-relationship-role>
      <ejb-relationship-role-name>FolderToDevices</ejb-relationship-role-name>
      <key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>DeviceToFolder</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name></field-name>
      <column-name></column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>

      I guess the field-name and column-name need data here. but what is making it not appear with generation

      ant 1.6.2
      jboss 4.0
      xdoclet 1.2.1

      Your help is appreciated.