camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathieu Lalonde (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-4350) Camel-jdbc with List<Map> has arbitrary column order
Date Tue, 30 Aug 2011 23:04:09 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094175#comment-13094175
] 

Mathieu Lalonde commented on CAMEL-4350:
----------------------------------------

Based on the SqlProducer code & the javadoc for Spring's ColumnMapRowMapper, the keys
should already be in a deterministic order.  I can add a unit test in case we change the implementation
down the road.

> Camel-jdbc with List<Map> has arbitrary column order
> ----------------------------------------------------
>
>                 Key: CAMEL-4350
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4350
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jdbc, camel-sql
>    Affects Versions: 2.7.1
>         Environment: java 1.6
>            Reporter: Julian Cable
>            Assignee: Mathieu Lalonde
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: camel-jdbc_keyOrdering.tar
>
>
> The following route works but the order of the columns is dependent on the natural ordering
of the hashmap. Target systems will have an expectation of the order of the data. 
> <route>
>   <from uri="jetty:http://0.0.0.0:16081/css/mes"/>
>   <setBody>
>     <constant>SELECT id, value1, value2 FROM mytable</constant> 
>   </setBody>
>   <to uri="jdbc:mydb"/>
>   <marshal>
>     <csv/>
>   </marshal>
>  </route>
> Either there needs to be a property for csv that allows hash key ordering to be specified,
or an option to sort the keys, e.g.
> <route>
>   <from uri="jetty:http://0.0.0.0:16081/css/mes"/>
>   <setBody>
>     <constant>SELECT id as col1, value1 as col2, value2 as col3 FROM mytable</constant>

>   </setBody>
>   <to uri="jdbc:mydb"/>
>   <marshal>
>     <csv sortFields="true" />
>   </marshal>
>  </route>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message