...
This component will by default load the MyBatis SqlMapConfig file from the root of the classpath with the expected name of SqlMapConfig.xml
.
If the file is located in another location, you will need to configure the configurationUri
option on the MyBatisComponent
component.
Options
Div |
---|
class | confluenceTableSmall |
---|
|
Option | Type | Default | Description |
---|
consumer.onConsume | String | null | Statements to run after consuming. Can be used, for example, to update rows after they have been consumed and processed in Camel. See sample later. Multiple statements can be separated with commas. | consumer.useIterator | boolean | true | If true each row returned when polling will be processed individually. If false the entire List of data is set as the IN body. | consumer.routeEmptyResultSet | boolean | false | Sets whether empty result sets should be routed. | statementType | StatementType | null | Mandatory to specify for the producer to control which kind of operation to invoke. The enum values are: SelectOne , SelectList , Insert , InsertList , Update , UpdateList , Delete , and DeleteList . Notice: InsertList is available as of Camel 2.10, and UpdateList , DeleteList is available as of Camel 2.11. | maxMessagesPerPoll | int | 0 | An integer to define the maximum messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disable it. | executorType | String | null | Camel 2.11: The executor type to be used while executing statements. The supported values are: simple, reuse, batch. By default, the value is not specified and is equal to what MyBatis uses, i.e. simple. simple executor does nothing special. reuse executor reuses prepared statements. batch executor reuses statements and batches updates. |
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Option || Type || Default || Description ||
| {{consumer.onConsume}} | {{String}} | {{null}} | Statements to run after consuming. Can be used, for example, to update rows after they have been consumed and processed in Camel. See sample later. Multiple statements can be separated with commas. |
| {{consumer.useIterator}} | {{boolean}} | {{true}} | If {{true}} each row returned when polling will be processed individually. If {{false}} the entire {{List}} of data is set as the IN body. |
| {{consumer.routeEmptyResultSet}} | {{boolean}} | {{false}} | Sets whether empty result sets should be routed. |
| {{statementType}} | {{StatementType}} | {{null}} | Mandatory to specify for the producer to control which kind of operation to invoke. The enum values are: {{SelectOne}}, {{SelectList}}, {{Insert}}, {{InsertList}}, {{Update}}, {{UpdateList}}, {{Delete}}, and {{DeleteList}}. *Notice:* {{InsertList}} is available as of Camel 2.10, and {{UpdateList}}, {{DeleteList}} is available as of Camel 2.11. |
| {{maxMessagesPerPoll}} | {{int}} | {{0}} | An integer to define the maximum messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disable it. |
| {{executorType}} | {{String}} | {{null}} | *Camel 2.11:* The executor type to be used while executing statements. The supported values are: simple, reuse, batch. By default, the value is not specified and is equal to what MyBatis uses, i.e. *simple*. \\ *simple* executor does nothing special. \\ *reuse* executor reuses prepared statements. \\ *batch* executor reuses statements and batches updates. |
{div} |
Camel will populate the result message, either IN or OUT with a header with the statement used:
Div |
---|
class | confluenceTableSmall |
---|
|
Header | Type | Description |
---|
CamelMyBatisStatementName | String | The statementName used (for example: insertAccount). | CamelMyBatisResult | Object | The response returned from MtBatis in any of the operations. For instance an INSERT could return the auto-generated key, or number of rows etc. |
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Header || Type || Description ||
| {{CamelMyBatisStatementName}} | {{String}} | The *statementName* used (for example: insertAccount). |
| {{CamelMyBatisResult}} | {{Object}} | The *response* returned from MtBatis in any of the operations. For instance an {{INSERT}} could return the auto-generated key, or number of rows etc. |
{div} |
Message Body
The response from MyBatis will only be set as the body if it's a SELECT
statement. That means, for example, for INSERT
statements Camel will not replace the body. This allows you to continue routing and keep the original body. The response from MyBatis is always stored in the header with the key CamelMyBatisResult
.
...