Trying to use a mapping as both a structure and a collection does not work. 
----------------------------------------------------------------------------

         Key: JIBX-89
         URL: http://jira.codehaus.org/browse/JIBX-89
     Project: JiBX
        Type: Bug

  Components: Generator Tools  
 Environment: Windows 2K,  Oracle JDeveloper
    Reporter: Thomas Jones-Low
 Attachments: src.zip

This affect RC2, I've attached the binding file, the source data files and the 
example xml file. 

I have a mapping (short version): 

    <mapping class="com.softstart.stellar.data.HexID" post-set="convertHextoID" 
abstract="true">
        <value style="attribute" name="type" field="hexType" />
        <value style="attribute" name="group" field="hexGroup" />
        <value style="text" field="hex" />
    </mapping> 

I would like to use this mapping in two ways, as a structure in one mapping: 

    <mapping name="system" class="com.softstart.stellar.data.StarSystem" 
post-set="update">
        <value style="attribute" name="id" field="key" />
        <value style="attribute" name="provider" field="providerName" 
usage="optional" />
        <value name="name" field="name" />
        <structure field="location" name="location"/>
   </mapping>

and as a collection of locations in another mapping: 

    <mapping name="link" class="com.softstart.stellar.data.Links">
        <structure map-as="com.softstart.stellar.data.Record" />
        <collection field="hexes" item-type="com.softstart.stellar.data.HexID"/>
        <value style="attribute" name="linkType" field="linkTypeName" 
usage="optional"/>
    </mapping>

In order for the second mapping to work (the links collection) I need to give 
the HexID mapping a name attribute. But if I do so the system mapping fails on 
reading, because it's now looking for a nested <location><location> tag. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to