...
Where operationName is the name in the iBATIS XML configuration file which maps to the query, insert, update or delete operation you wish to evaluate.
Options
None
Message Headers
Camel will populate the result message, either IN or OUT with a header with the operationName used:
Header | Type | Description |
---|---|---|
| String | The operationName used (for example: insertAccount) |
Samples
For example if you wish to consume beans from a JMS queue and insert them into a database you could do.
Code Block |
---|
from("activemq:queue:Some.QueuenewAccount"). to("ibatis:insertAccount"); |
...
In the sample below we poll the database, every 30th second using the Timer component and sends the data to the JMS queue:
Code Block | ||||
---|---|---|---|---|
| ||||
from("timer://pollTheDatabase?delay=30000").to("ibatis:selectAllAccounts").to("activemq:queue:allAccounts");
|
And the iBatis SQL map file used:
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- Select with no parameters using the result map for Account class. -->
<select id="selectAllAccounts" resultMap="AccountResult">
select * from ACCOUNT
</select>
| ||||
Wiki Markup | ||||
{snippet:id=e1|lang=java|url=activemq/camel/trunk/components/camel-ibatis/src/test/java/org/apache/camel/component/ibatis/IBatisPollingDelayRouteTest.java} |
Include Page | ||||
---|---|---|---|---|
|