[ 
http://jira.codehaus.org/browse/JIBX-184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dennis Sosnoski reassigned JIBX-184:
------------------------------------

    Assignee: Dennis Sosnoski

> ident="ref" doesn't work when the target mapping is abstract
> ------------------------------------------------------------
>
>                 Key: JIBX-184
>                 URL: http://jira.codehaus.org/browse/JIBX-184
>             Project: JiBX
>          Issue Type: Bug
>          Components: core
>    Affects Versions: JiBX 1.1.5
>            Reporter: Daniel Uribe
>            Assignee: Dennis Sosnoski
>            Priority: Critical
>         Attachments: jibx.patch
>
>
> When a value defined as ident="ref" references an abstract mapping, JIBX 
> tries to resolve the mapping using the data type for the field, which doesn't 
> work for abstract mappings.
> Sample mapping fragment with problem:
> <mapping name="test" class="testRootClass">
>   <structure name="def" map-as="_def" />
>   <structure name="ref" map-as="_ref" />
> </mapping>
> <mapping abstract="true" type-name="_def" class="testDefClass">
>   <value name="ID" style="attribute" field="id" ident="def" />
> </mapping>
> <mapping abstract="true" type-name="_ref" class="testRefClass">
>   <value name="REFERENCE" style="attribute" field="reference" 
> usage="optional" ident="ref"  />
> </mapping>
> Sample XML fragment:
> <test>
>   <def id="1">
>   <ref reference="1">
> </test>
> In the case above, jibx would try to resolve the mapping using the data type 
> of the reference field in the testRefClass, which is of type testDefClass. 
> The problem is that the hashmap with the mapping uses the name of the 
> abstract mapping instead (_def).
> ----
> I would recommend to add another attribute (idref-map-as) to the value 
> element to specify the name of the abstract mapping to use when matching the 
> ident="ref" to the appropriate mapping that has the ident="def". This 
> includes changes to the jibx schema (binding.xsd), as well as changes to the 
> classes representing the value element (ValueChild & ValueElement) and the 
> class that builds the binding (BindingBuilder).
> Find a patch file attached including those proposed changes.
> The attached

-- 
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

        

------------------------------------------------------------------------------
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to