on 04-06-2005 4:09 PM
Like in this manual
http://help.sap.com/saphelp_nw04/helpdata/de/76/c6ba3eb645dc61e10000000a114084/content.htm
i tried to map EJB-Fields from different EJBs to an existing dictionary. Inside the ejb-jar.xml was the following text:
<i> <relationships>
<ejb-relation>
<description>description</description>
<ejb-relation-name>CatDatRelation</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.CategoryBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>CategoryBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>catDatRel</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.DataBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>DataBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships></i>
How do I the many-to-many-relationship? My Guess was:
<i> <relationships>
<ejb-relation>
<description>description</description>
<ejb-relation-name>CatDatRelation</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.CategoryBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>CategoryBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>catDatRel</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field>
<cmr-field>
<cmr-field-name>DatCatRel</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.DataBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>DataBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships></i>
It didn't work. Can anybody help me, please?
Hi Richard,
You can only have 0 or 1 cmr-field per ejb-relationship-role. So to make the relationship bidirectional, the second cmr-field should be in the second ejb-relationship-role:
<i><relationships>
<ejb-relation>
<description>description</description>
<ejb-relation-name>CatDatRelation</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.CategoryBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>CategoryBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>catDatRel</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>com.eonis.test.DataBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>DataBean</ejb-name>
</relationship-role-source>
<b><cmr-field>
<cmr-field-name>DatCatRel</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field></b>
</ejb-relationship-role>
</ejb-relation>
</relationships></i>
Hope that helps,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.