camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine DESSAIGNE <antoine.dessai...@gmail.com>
Subject Re: Possibility of jdbc component when performing a select to return a map
Date Mon, 16 Mar 2015 17:49:28 GMT
Hi,

No, it's not possible. In order to be unique in your Map it has to know
which fields are part of key (assuming that you retrieve them all).

If you have camel-groovy in your project you can do the following:
to("jdbc:something").setBody(new
GroovyExpression("request.body.collectEntries {[(it.COLUMN_A): it]}"))

Otherwise you'll have to use a custom processor.

Hope this helps,

Antoine.


2015-03-16 17:43 GMT+01:00 angelo.rlcosta <angelo.rlcosta@gmail.com>:

> HI Guys,
>
> i'm using jdbc component to perform a selectList. I've noticed that
> according to the impl it returns a List<Map&lt;String, Object>> data =
> extractResultSetData(rs);
>
> Is there any type of transformation i can perform to have data like
> Map<String, Map&lt;String, Object>> so instead of a List i have a Map where
> the key is for example List[i].COLUMN_A and then the inner map the same as
> the Map in the List.
>
> Thanks in advance,
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Possibility-of-jdbc-component-when-performing-a-select-to-return-a-map-tp5764228.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message