camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Piwoni (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-5031) Dozer Type Conversion Does Not Work With Context Based Mappings (map-id)
Date Wed, 22 Feb 2012 22:27:50 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-5031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andre Piwoni updated CAMEL-5031:
--------------------------------

    Description: 
DozerTypeConverter utilizes DozerBeanMappper's method map(Object source, Class<T> destinationClass)
to convert objects. Unfortunately, this does not work for Dozer's context based mapping with
map-id because it requires call to DozerBeanMappper.map(Object source, Class<T> destinationClass,
String mapId).

Example below does not work without map-id, which is actually required for this type of mapping
(see http://dozer.sourceforge.net/documentation/faq.html#complex-to-map)

<mapping  map-id="myMapping">
   <class-a>x.y.z.ComplexType</class-a>
   <class-b>java.util.Map</class-b>
   <field copy-by-reference="true">
      <a>complexTypeField</a>
      <b key="complexTypeFieldKeyName">this</b>
  </field>
  ...
</mapping>

DozerTypeConverterLoader has access to ClassMap and its map-id, if any, in order to construct
a lookup for map-id for a given conversion pair. This is tricky, however, since there can
be multiple mappings with different ids for the same conversion pair.
Interfaces for Dozer and Camel Conversion may not be fully compatible but at least limitations
should be stated in documentation.

Regards,
Andre Piwoni

  was:
DozerTypeConverter utilizes DozerBeanMappper's method map(Object source, Class<T> destinationClass)
to convert objects. Unfortunately, this does not work for Dozer's context based mapping with
map-id because it requires call to DozerBeanMappper.map(Object source, Class<T> destinationClass,
String mapId).

Example below does not work without map-id, which is actually required for this type of mapping
(see http://dozer.sourceforge.net/documentation/faq.html#complex-to-map)

<mapping  map-id="myMapping">
   <class-a>x.y.z.ComplexType</class-a>
   <class-b>java.util.Map</class-b>
   <field copy-by-reference="true">
      <a>complexTypeField</a>
      <b key="complexTypeFieldKeyName">this</b>
  </field>
  ...
</mapping>

DozerTypeConverterLoader has access to ClassMap and its map-id, if any, in order to construct
a lookup for map-id for a given conversion pair. This is tricky, however, since there can
be multiple mappings with different ids for the same conversion pair.
Interfaces for Dozer and Camel Conversion may not be fully compatible but least limitations
should be stated in documentation.

Regards,
Andre Piwoni

    
> Dozer Type Conversion Does Not Work With Context Based Mappings (map-id)
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-5031
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5031
>             Project: Camel
>          Issue Type: Bug
>          Components: bean-integration, camel-core
>    Affects Versions: 2.6.0, 2.9.0
>            Reporter: Andre Piwoni
>            Priority: Minor
>
> DozerTypeConverter utilizes DozerBeanMappper's method map(Object source, Class<T>
destinationClass) to convert objects. Unfortunately, this does not work for Dozer's context
based mapping with map-id because it requires call to DozerBeanMappper.map(Object source,
Class<T> destinationClass, String mapId).
> Example below does not work without map-id, which is actually required for this type
of mapping (see http://dozer.sourceforge.net/documentation/faq.html#complex-to-map)
> <mapping  map-id="myMapping">
>    <class-a>x.y.z.ComplexType</class-a>
>    <class-b>java.util.Map</class-b>
>    <field copy-by-reference="true">
>       <a>complexTypeField</a>
>       <b key="complexTypeFieldKeyName">this</b>
>   </field>
>   ...
> </mapping>
> DozerTypeConverterLoader has access to ClassMap and its map-id, if any, in order to construct
a lookup for map-id for a given conversion pair. This is tricky, however, since there can
be multiple mappings with different ids for the same conversion pair.
> Interfaces for Dozer and Camel Conversion may not be fully compatible but at least limitations
should be stated in documentation.
> Regards,
> Andre Piwoni

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message