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

Zemian Deng updated CAMEL-6366:
-------------------------------

    Attachment: CAMEL-6366.patch

Hi there,

Attached is a patch for this new feature. I have added two new URI params:

{{outputType=Map|List|Object}} default to {{Map}}

Map - just as original, which generate List of Map output
List - generate List of List. Each inner list is a row record values. No column 
name will be outputted.
Object - generate a List of user custom object and populate fields from each 
row of record. When using this, you also need to set {{outputClass}} for the 
type that will be converted to.

{{outputClass=objectTypeClassName}} default to {{null}}

I have updated both Consumer and Producer to check for these flags and perform 
output accordingly.

I have also added new unit tests that covered the use cases.

Let me know how this works out for you.

Zemian Deng
                
> SQL component - Add option to dictate if output is list, object or map
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-6366
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6366
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-sql
>            Reporter: Claus Ibsen
>             Fix For: 2.12.0
>
>         Attachments: CAMEL-6366.patch
>
>
> When using the sql component, the output is always a List<Map>.
> It would be nice if you could configure an option to say its a 
> - selectForObject
> - selectForList
> - selectForMap
> Like MyBatis can do.
> Also we can consider having a way to store the output on a header instead of 
> altering the body. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to