This content has been marked as final. Show 1 reply
I found a solution. In jbosscmp-jdbd.xml you add:
<relationships> ... <ejb-relation> <ejb-relationship-role> <ejb-relationship-role-name>role-name</ejb-relationship-role-name> <key-fields> <key-field> <field-name><!-- include here the name of the primary key field of the other side (ie. id)--></field-name> <column-name><!-- include here the name you want to give to you foreign key column (ie. address_id)--></column-name> </key-field> </key-fields> </ejb-relationship-role> ... </ejb-relation> </relationships>
If you use xdoclet you just add:
... * * @jboss.relation * related-pk-field = "id" * fk-column = "adress_id" * ...