I'm willing to track down and fix this ([Xdoclet-user] sunone cmr bug), but I could use some help from someone to lead the way.

I've observed two distinct problems in the sunone subtask:
1) In every entity-mapping, sunone subtask creates a cmr-field-mapping for all relationships in the ejb-jar.xml.
2) For every cmr-field-mapping generated, sunone only generates from the perspective of one side of the relationship (left side?)

Here is the relevant template code from the sun-cmp-mapping_xml.xdt file (xdoc 1.2.1):
<XDtEjbRel:ifHasRelationships>
<XDtEjbRel:forAllRelationships>
<XDtEjbRel:ifLeftNavigable>
    <cmr-field-mapping>
       <cmr-field-name>XDtEjbRel:leftFieldName/></cmr-field-name>
          ....
    </cmr-field-mapping>

>From observerving the behavior of this code, and the code in ejb.dd.RelationsTagsHandler,  I'd intepret the above to say:
If there are any relationships
    for all relationships
       if the relation is 'left navigable'
          create the <cmr-field-mapping> template using the 'left' field name.


Instead, I think this code should do this:
If there are any relationships 
    for all relationships

       if this relationship is 'left-navigable' and this bean is on the 'right-end' of the relationship
          create mapping using the 'left' field name.
       if this relationship is 'right-navigable' and this bean is on the 'left-end' of the relationship
          create mapping using the 'right' field name.

Any comments?

What would be the best way to code this?  I'm only looking for direction here because I'm not familiar with the xdoclet template language.   The principal question: How to encode "if left-navigable and this bean is on the right end of the relationship"?


Thanks,
John

Reply via email to