Author: buildbot
Date: Fri Oct  9 17:18:53 2015
New Revision: 968331

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/elsql.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/elsql.html
==============================================================================
--- websites/production/camel/content/elsql.html (original)
+++ websites/production/camel/content/elsql.html Fri Oct  9 17:18:53 2015
@@ -96,13 +96,13 @@
 </div></div><div class="confluence-information-macro 
confluence-information-macro-information"><span class="aui-icon aui-icon-small 
aui-iconfont-info confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>This component can be used as a <a 
shape="rect" class="external-link" 
href="http://camel.apache.org/transactional-client.html";>Transactional 
Client</a>.</p></div></div><p>The SQL component uses the following endpoint URI 
notation:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[sql:elSqlName:resourceUri[?options]
 ]]></script>
-</div></div><p>You can append query options to the URI in the following 
format,&#160;<code style="line-height: 
1.42857;">?option=value&amp;option=value&amp;...</code></p><p>The parameters to 
the SQL queries are named parameters in the elsql mapping files, and maps to 
corresponding keys from the Camel message,&#160;in the given 
precedence:</p><p>1. from message body if its a <code>java.util.Map</code><br 
clear="none"> 2. from message headers</p><p>If a named parameter cannot be 
resolved, then an exception is thrown.</p><h3 
id="ElSql-Options">Options</h3><div class="confluenceTableSmall"><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><code>re
 sourceUri</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">String</td><td colspan="1" rowspan="1" 
class="confluenceTd">null</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Required</strong> The resource file which contains 
the elsql SQL statements to use. You can specify multiple resources separated 
by comma. The resources are loaded on the classpath by default, you can prefix 
with file: to load from file system. Notice you can set this option on the 
component and then you do not have to configure this on the 
endpoint.</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>elSqlConfig</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">null</td><td colspan="1" rowspan="1" 
class="confluenceTd">To use a specific configured ElSqlConfig. It may be better 
to use the databaseVendor option instead.</td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><code>databaseVendor</code>
 </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td 
colspan="1" rowspan="1" class="confluenceTd">Default</td><td colspan="1" 
rowspan="1" class="confluenceTd">To use a vendor specific ElSqlConfig. The 
possible values are: Default, Postgres, HSql, MySql, Oracle, SqlServer2008, 
Veritca</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>batch</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Execute SQL batch update statements. See 
notes below on how the treatment of the inbound message body changes if this is 
set to <code>true</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>dataSource</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</
 code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to 
a <code>DataSource</code> to look up in the registry.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>template.&lt;xxx&gt;</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Sets additional options on the Spring 
NamedParameterJdbcTemplate that is used behind the scenes to execute the 
queries. For instance, <code>template.maxRows=10</code>. For detailed 
documentation, see the NamedParameterJdbcTemplate javadoc 
documentation.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>long</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" 
rowspan="1" class="conflue
 nceTd"><p>Delay in milliseconds between each poll.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.initialDelay</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>long</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Milliseconds before polling 
starts.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.useFixedDelay</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Set to <code>true</code> to use fixed delay 
between polls, otherwise fixed rate is used. See <a shape="rect" 
class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html";
 rel="nofollow">ScheduledExecutorServ
 ice</a> in JDK for details.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>maxMessagesPerPoll</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>int</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>An integer value to define the maximum 
number of messages to gather per poll. By default, no maximum is 
set.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.useIterator</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If <code>true</code> each row returned when 
polling will be processed individually. If <code>false</code> the entire 
<code>java.util.List</code> of data is set as the IN body.</p></td></tr><tr><td 
colspan="1" rowspan="1" clas
 s="confluenceTd"><p><code>consumer.routeEmptyResultSet</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Whether to route a single empty <a 
shape="rect" href="exchange.html">Exchange</a> if there was no data to 
poll.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.onConsume</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>After processing each row then this query 
can be executed, if the <a shape="rect" href="exchange.html">Exchange</a> was 
processed successfully, for example to mark the row as processed. The query can 
have parameter.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p
 ><code>consumer.onConsumeFailed</code></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p>After processing each row then this query 
 >can be executed, if the <a shape="rect" href="exchange.html">Exchange</a> 
 >failed, for example to mark the row as failed. The query can have 
 >parameter.</p></td></tr><tr><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>consumer.onConsumeBatchComplete</code></p></td><td
 > colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p>After processing the entire batch, this 
 >query can be executed to bulk update rows etc. The query cannot have 
 >parameters.</p></td></tr><tr><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>consumer.breakBatch
 OnConsumeFail</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If using <code>consumer.onConsume</code> 
and it fails, then this option controls whether to break out of the batch or 
continue processing the next row from the batch.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputType</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>SelectList</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Make the output of consumer or 
producer to <code>SelectList</code> as List of Map, or <code>SelectOne</code> 
as single Java object in the following way:<br clear="none"> a) If the query 
has only single column, then that JDBC Column object is returned. (such as 
<code>SELEC
 T COUNT( * ) FROM PROJECT</code> will return a Long object.<br clear="none"> 
b) If the query has more than one column, then it will return a Map of that 
result.<br clear="none"> c) If the <code>outputClass</code> is set, then it 
will convert the query result into an Java bean object by calling all the 
setters that match the column names. It will assume your class has a default 
constructor to create instance with.<br clear="none"> d) If the query resulted 
in more than one rows, it throws an non-unique result exception.</p><p>Tthe 
SelectList also supports mapping each row to a Java object as the SelectOne 
does <span>(only step c)</span>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputClass</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Specify the full package and class name t
 o use as conversion when 
<code>outputType=SelectOne</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputHeader</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>String</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>To store the result as a header instead of 
the message body. This allows to preserve the existing message body 
as-is.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>noop</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If set, will ignore the results of the SQL 
query and use the existing IN message as the OUT message for the continuation 
of processing</p></td></tr></tbody></table></div></div><h3 
id="ElSql-Resultofthequery">Resul
 t of the query</h3><p>For <code>select</code> operations, the result is an 
instance of <code>List&lt;Map&lt;String, Object&gt;&gt;</code> type, as 
returned by the JdbcTemplate.queryForList() method. For <code>update</code> 
operations, the result is the number of updated rows, returned as an 
<code>Integer</code>.</p><p>By default, the result is placed in the message 
body.&#160; If the outputHeader parameter is set, the result is placed in the 
header.&#160; This is an alternative to using a full message enrichment pattern 
to add headers, it provides a concise syntax for querying a sequence or some 
other small value into a header.&#160; It is convenient to use outputHeader and 
outputType together:</p><h3 id="ElSql-Headervalues">Header values</h3><p>When 
performing <code>update</code> operations, the SQL Component stores the update 
count in the following message headers:</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"
 ><p>Header</p></th><th colspan="1" rowspan="1" 
 >class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
 >rowspan="1" 
 >class="confluenceTd"><p><code>CamelSqlUpdateCount</code></p></td><td 
 >colspan="1" rowspan="1" class="confluenceTd"><p>The number of rows updated 
 >for <code>update</code> operations, returned as an <code>Integer</code> 
 >object.</p></td></tr><tr><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>CamelSqlRowCount</code></p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p>The number of rows returned for 
 ><code>select</code> operations, returned as an <code>Integer</code> 
 >object.</p></td></tr></tbody></table></div><h4 
 >id="ElSql-Sample">Sample</h4><p><span style="line-height: 1.42857;">In the 
 >given route below, we want to get all the projects from the projects table. 
 >Notice the SQL query has 2 named parameters, :#lic and 
 >:#min.</span></p><p>Camel will then lookup for these parameters from the 
 >message body or message headers. Notice in the example above
  we set two headers with constant value<br clear="none"> for the named 
parameters:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+</div></div><p>You can append query options to the URI in the following 
format,&#160;<code style="line-height: 
1.42857;">?option=value&amp;option=value&amp;...</code></p><p>The parameters to 
the SQL queries are named parameters in the elsql mapping files, and maps to 
corresponding keys from the Camel message,&#160;in the given 
precedence:</p><p>1. <strong>Camel 2.16.1:</strong>&#160;from message body 
if&#160;<a shape="rect" href="simple.html">Simple</a> expression.</p><div>2. 
from message body if its a <code style="line-height: 1.42857;">java.util.Map<br 
clear="none"></code>3. from message headers</div><p>If a named parameter cannot 
be resolved, then an exception is thrown.</p><h3 
id="ElSql-Options">Options</h3><div class="confluenceTableSmall"><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" 
class="confluenc
 eTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><code>resourceUri</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" 
class="confluenceTd">null</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Required</strong> The resource file which contains 
the elsql SQL statements to use. You can specify multiple resources separated 
by comma. The resources are loaded on the classpath by default, you can prefix 
with file: to load from file system. Notice you can set this option on the 
component and then you do not have to configure this on the 
endpoint.</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>elSqlConfig</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">null</td><td colspan="1" rowspan="1" 
class="confluenceTd">To use a specific configured
  ElSqlConfig. It may be better to use the databaseVendor option 
instead.</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>databaseVendor</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">Default</td><td colspan="1" rowspan="1" 
class="confluenceTd">To use a vendor specific ElSqlConfig. The possible values 
are: Default, Postgres, HSql, MySql, Oracle, SqlServer2008, 
Veritca</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>batch</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Execute SQL batch update statements. See 
notes below on how the treatment of the inbound message body changes if this is 
set to <code>true</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>dataSour
 ce</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Reference to a <code>DataSource</code> to look up in 
the registry.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>template.&lt;xxx&gt;</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Sets additional options on the Spring 
NamedParameterJdbcTemplate that is used behind the scenes to execute the 
queries. For instance, <code>template.maxRows=10</code>. For detailed 
documentation, see the NamedParameterJdbcTemplate javadoc 
documentation.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" 
rowspan="1" class="
 confluenceTd"><p><code>long</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Delay in milliseconds between each 
poll.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.initialDelay</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>long</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Milliseconds before polling 
starts.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.useFixedDelay</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Set to <code>true</code> to use fixed delay 
between polls, otherwise fixed rate is used. See <a shape="
 rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html";
 rel="nofollow">ScheduledExecutorService</a> in JDK for 
details.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>maxMessagesPerPoll</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>int</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>An integer value to define the maximum 
number of messages to gather per poll. By default, no maximum is 
set.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.useIterator</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If <code>true</code> each row returned when 
polling will be pro
 cessed individually. If <code>false</code> the entire 
<code>java.util.List</code> of data is set as the IN body.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.routeEmptyResultSet</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Whether to route a single empty <a 
shape="rect" href="exchange.html">Exchange</a> if there was no data to 
poll.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.onConsume</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>After processing each row then this query 
can be executed, if the <a shape="rect" href="exchange.html">Exchange</a> was pr
 ocessed successfully, for example to mark the row as processed. The query can 
have parameter.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.onConsumeFailed</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>After processing each row then 
this query can be executed, if the <a shape="rect" 
href="exchange.html">Exchange</a> failed, for example to mark the row as 
failed. The query can have parameter.</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>consumer.onConsumeBatchComplete</code></p></td><td
 colspan="1" rowspan="1" 
class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>After processing the entire batch, this query can be 
 executed to bulk update rows etc. The query cannot have 
parameters.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.breakBatchOnConsumeFail</code></p></td><td
 colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If using <code>consumer.onConsume</code> 
and it fails, then this option controls whether to break out of the batch or 
continue processing the next row from the batch.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputType</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>SelectList</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Make the output of consumer or 
producer to <code>SelectList</code> as List of Map, or <code>SelectOne</code> a
 s single Java object in the following way:<br clear="none"> a) If the query 
has only single column, then that JDBC Column object is returned. (such as 
<code>SELECT COUNT( * ) FROM PROJECT</code> will return a Long object.<br 
clear="none"> b) If the query has more than one column, then it will return a 
Map of that result.<br clear="none"> c) If the <code>outputClass</code> is set, 
then it will convert the query result into an Java bean object by calling all 
the setters that match the column names. It will assume your class has a 
default constructor to create instance with.<br clear="none"> d) If the query 
resulted in more than one rows, it throws an non-unique result 
exception.</p><p>Tthe SelectList also supports mapping each row to a Java 
object as the SelectOne does <span>(only step c)</span>.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputClass</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colsp
 an="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Specify the full package and 
class name to use as conversion when 
<code>outputType=SelectOne</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outputHeader</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>String</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>To store the result as a header instead of 
the message body. This allows to preserve the existing message body 
as-is.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>noop</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>If set, will ignore the results of the SQL 
query an
 d use the existing IN message as the OUT message for the continuation of 
processing</p></td></tr></tbody></table></div></div><h3 
id="ElSql-Resultofthequery">Result of the query</h3><p>For <code>select</code> 
operations, the result is an instance of <code>List&lt;Map&lt;String, 
Object&gt;&gt;</code> type, as returned by the JdbcTemplate.queryForList() 
method. For <code>update</code> operations, the result is the number of updated 
rows, returned as an <code>Integer</code>.</p><p>By default, the result is 
placed in the message body.&#160; If the outputHeader parameter is set, the 
result is placed in the header.&#160; This is an alternative to using a full 
message enrichment pattern to add headers, it provides a concise syntax for 
querying a sequence or some other small value into a header.&#160; It is 
convenient to use outputHeader and outputType together:</p><h3 
id="ElSql-Headervalues">Header values</h3><p>When performing 
<code>update</code> operations, the SQL Component stores the up
 date count in the following message headers:</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>CamelSqlUpdateCount</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>The number of rows updated for 
<code>update</code> operations, returned as an <code>Integer</code> 
object.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>CamelSqlRowCount</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The number of rows returned for 
<code>select</code> operations, returned as an <code>Integer</code> 
object.</p></td></tr></tbody></table></div><h4 
id="ElSql-Sample">Sample</h4><p><span style="line-height: 1.42857;">In the 
given route below, we want to get all the projects from the projects table. 
Notice the SQL query has 2
  named parameters, :#lic and :#min.</span></p><p>Camel will then lookup for 
these parameters from the message body or message headers. Notice in the 
example above we set two headers with constant value<br clear="none"> for the 
named parameters:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[   from(&quot;direct:projects&quot;)
      .setHeader(&quot;lic&quot;, constant(&quot;ASF&quot;))
      .setHeader(&quot;min&quot;, constant(123))
      .to(&quot;elsql:projects:com/foo/orders.elsql&quot;)
 ]]></script>
-</div></div><p>And the <a shape="rect" class="external-link" 
href="https://github.com/OpenGamma/ElSql"; rel="nofollow">elsql</a> mapping 
file</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+</div></div><p>And the <a shape="rect" class="external-link" 
href="https://github.com/OpenGamma/ElSql"; style="line-height: 1.42857;" 
rel="nofollow">elsql</a> mapping file</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@NAME(projects)
   SELECT *
   FROM projects
@@ -112,7 +112,13 @@
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[   from(&quot;direct:projects&quot;)
      .to(&quot;elsql:projects:com/foo/orders.elsql&quot;)
 ]]></script>
-</div></div><h4 
id="ElSql-SeeAlsoConfiguringCamelComponentEndpointGettingStarted"></h4><h3 
id="ElSql-SeeAlso">See Also</h3>
+</div></div><p>&#160;</p><p>In from Camel 2.16.1 onwards you can use Simple 
expressions as well, which allows to use an OGNL like notation on the message 
body, where it assumes to have&#160;<code>getLicense</code> 
and&#160;<code>getMinimum</code> methods:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@NAME(projects)
+  SELECT *
+  FROM projects
+  WHERE license = :${body.license} AND id &gt; :${body.minimum}
+  ORDER BY id]]></script>
+</div></div><p></p><h3 id="ElSql-SeeAlso">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul 
class="alternate"><li><a shape="rect" href="sql-component.html">SQL 
Component</a></li><li><a shape="rect" 
href="mybatis.html">MyBatis</a></li><li><a shape="rect" 
href="jdbc.html">JDBC</a></li></ul></div>
         </td>
         <td valign="top">


Reply via email to