This content has been marked as final.
Show 3 replies
-
1. Re: Many-to-many relation: How is my ejb container aware of
sesques May 1, 2004 11:28 AM (in response to balteo)Hi Julien,
In JBoss, the mapping is always done in jbosscmp-jdbc.xml
In this file, your relation should be something like;<ejb-relation> <ejb-relation-name>Etablishment-Category</ejb-relation-name> <relation-table-mapping> <table-name>establishments_categories</table-name> <datasource>Your data source</datasource> <datasource-mapping>Your data source mapping</datasource-mapping> <create-table>What you want</create-table> <remove-table>What you want</remove-table> </relation-table-mapping> <ejb-relationship-role> <!-- Etablishment side --> <ejb-relationship-role-name>Etablishment-have-Category</ejb-relationship-role-name> <key-fields> <key-field> <field-name>etablishment_id</field-name> <column-name>db_establishment_id</column-name> </key-field> </key-fields> </ejb-relationship-role> <ejb-relationship-role> <!-- Category side --> <ejb-relationship-role-name>Category-belongs-to-Etablishment</ejb-relationship-role-name> <key-fields> <key-field> <field-name>category_id</field-name> <column-name>db_category_id</column-name> </key-field> </key-fields> </ejb-relationship-role> </ejb-relation>
Something important: You must repeat the datasource and datasource mapping in the relation-table-mapping if you don't set it in the default section.
I suggest you using XDoclet to generate all the descriptors. -
2. Many-to-many relation.
balteo May 1, 2004 12:47 PM (in response to balteo)Thanks a lot for your reply Pascal,
Does Xdoclet work for ejb 2.1??
Julien. -
3. Re: Many-to-many relation: How is my ejb container aware of
sesques May 1, 2004 3:21 PM (in response to balteo)Hi Julien,
The current release 1.2 (I use the beta 3 myself) NO.
EJB 2.1 will be supported by XDoclet 2 but it is not yet relased.
Check the project at:http://xdoclet.codehaus.org/
Anyway, EJB 2.1 will be supported only on JBoss 4.x.x version, which is not yet released.