-
1. Re: CMR, CMP and entity bean using different tables
shogun Apr 27, 2002 7:01 AM (in response to marr)This example works with version 3.0 RC1. I don't know, if it works with the beta version. This example is based on table mapping:
employee 1 -* telecom.
table employee:
-> column employee_id
table employee_telecom:
-> column employee_id_fk
-> column telecom_id_fk
table telecom:
-> column telecom_id
An other relation like customer 1-* telecom is also possible with this design.
<ejb-relation>
<ejb-relation-name>employee-telecom</ejb-relation-name>
<relation-table-mapping>
<table-name>employee_telecom</table-name>
</relation-table-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>one-employee-has-many-telecoms</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>id</field-name>
<column-name>employee_id_fk</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>one-telecom-has-one-employee</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>id</field-name>
<column-name>telecom_id_fk</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
</ejb-relation>
Shogun -
2. Re: CMR, CMP and entity bean using different tables
marr Apr 29, 2002 4:35 AM (in response to marr)Thank's a lot. I tried as you said and it worked also with the beta version. The only problem is that the tables for relations are not deleted when undeploy is done, but I understood this problem is solved in 3.0 RC1 version.
marr