Hi!

[ This is a bit lengthly, but I don't think my English is good enough ]
[ to make it more concise, sorry. ]

I'm currently developing an EJB CMP-based project that is going to be
run on both JBoss 3.2 and Sun ONE application server 7. It has (among
other things) four entity beans:

 DefinedTransfer
 Client
 Account
 Operation

between them there are three relations:

 account-operations
 client-definedTransfer
 client-account

Here's how a proper sun-cmp-mappings.xml descriptor should look like
(pseudo-XML):

<sun-cmp-mappings>
  <sun-cmp-mapping>

    <entity-mapping>
      <ejb-name>Account</ejb-name>
      <!-- stuff like cmp-field-mapping goes here -->
      
      <cmr-field-mapping>
        <!-- this is a relation mapping for "Account", like
             account-operations -->
         <cmr-field-name>operations</cmr-field-name>
         <column-pair>
             <column-name>accounts.accountId</column-name>
             <column-name>operations.accountId_fk</column-name>
         </column-pair>
         <fetched-with>
             <none/>
         </fetched-with>
      </cmr-field-mapping>

    </entity-mapping>


    <entity-mapping>
      <ejb-name>Client</ejb-name>
      ...
      <cmr-field-mapping>
        <!-- this is a relation mapping for "Client", eg. client-account -->
      </cmr-field-mapping>
      <cmr-field-mapping>
        <!-- this is another relation mapping for "Client", eg.
             client-definedTransfer -->
      </cmr-field-mapping>
    </entity-mapping>
    
    <!-- other entity-mappings go here -->

  </sun-cmp-mapping>
</sun-cmp-mappings>

As you can see, each "entity-mapping" element should contain only those
"cmr-field-mapping" elements which are associated with the particular
entity bean.

However currently xdoclet 1.2 generates sun-cmp-mappings.xml in which
every entity-mapping contains cmr-field-mapping elements for EVERY
possible relation. This way I have 4*3=12 total "cmr-field-mapping"
elements in the file, and for each wrong element, the validator supplied
with SunONE server reports something like:

<test>
<test-name>tests.ejb.ias.cmpmapping.ASSunCmpMappingTest</test-name>
<test-assertion/>
<test-description>FAILED [JDO-GEN-CMP-Validation] : Unexpected exception
occured while initializing JDOCodeGenerator, for the mapping file [
META-INF/sun-cmp-mappings.xml ], of the ejb archive [ ClientServices ]
.Check stacktrace for details : [ java.lang.RuntimeException: No matching relationship 
field
 "operations" for bean "Operation" defined in the ejb-jar.xml file. ]
</test-description>
</test>

I browsed the xdoclet source and I believe the problem is usage of
"<XDtEjbRel:forAllRelationships>" in
modules/sun/src/xdoclet/modules/sun/sunone/ejb/resources/sun-cmp-mappings_xml.xdt

It is used in the same way as in
modules/jboss/src/xdoclet/modules/jboss/ejb/resources/jbosscmp-jdbc_xml.xdt,
but in that case the situation is different - all relations are listed
in one place. In case of sun-cmp-mappings.xml, only relations associated
with the bean currently being described should be iterated.

I hope this was clear enough despite my poor English skills.

Please let me know if my understanding of the problem is right, and if
it will be fixed soon :-)

regards,

Marcin
-- 
Marcin Owsiany <[EMAIL PROTECTED]>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to