camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6366) SQL component - Add option to dictate if output is list, object or map
Date Fri, 02 Aug 2013 06:29:50 GMT

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

Claus Ibsen commented on CAMEL-6366:
------------------------------------

Great work.

Object should be a single object returned, eg if you do a SQL like

select count(*) from my_table

Then using type=selectForObject will set the message body as an Object with the 1st value
of the 1st row from the ResultSet.
And I guess if you want to convert to specific value, then yeah having a objectType=Integer
eg to tell what Camel should convert the instance to, eg like if you use convertBodyTo in
the DSL.

Though we should probably be using names like MyBatis that is more intuitive (I should have
used these names in the description when I created this ticket).

type=SelectOne = like selectForObject
type=SelectList = like selectForMap

I am not sure if List<List> makes to much sense. I would rather align this with MyBatis
than come up with our own types.
I suggest to check out: http://camel.apache.org/mybatis


                
> 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

Mime
View raw message