Hi,

 

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

 

Folder

Key = “id”

 

Device

            Key = “id”

            Cmp-field  =  “folderId” (not defined as a key as 1 folder may contain many devices)

/**

    [EMAIL PROTECTED]

    * name="FolderMayContainDevices"

    * role-name="FolderToDevices"

    * target-ejb="Device"

    * target-multiple="yes"

    * target-role-name="DeviceToFolder"

    *

    [EMAIL PROTECTED]

    * related-pk-field="id”

    * fk-column="folderId”

    *

    [EMAIL PROTECTED]

    *

    */

   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.

 

Thanks

Sudhir

 

Reply via email to