Greetings,
I've found some similar questions asked in the past but there never seem to
be followups posted. I am looking for an example as how to perform batch
insert operations using MyBatis with Camel.
The desire is to be able to most efficiently insert 1000s of records at a
time from a List<beanObjet>.
My route currently returns such a list - it would be great to pass it right
along to:
to("mybatis:insertbeanObject?statementType=Insert");
This should be really simple - example SQL would be:
---snip---
INSERT INTO example
(example_id, name, value, other_value)
VALUES
(100, 'Name 1', 'Value 1', 'Other 1'),
(101, 'Name 2', 'Value 2', 'Other 2'),
(102, 'Name 3', 'Value 3', 'Other 3'),
(103, 'Name 4', 'Value 4', 'Other 4');
---snip---
Then there is this example snippet as how to configure the mapper xml:
http://code.google.com/p/mybatis/issues/detail?id=537
I don't see why this wouldn't work (and am working to attempt it), but
would find it very useful to see a working example if one exists.
There is this mainly unanswered thread:
http://mybatis-user.963551.n3.nabble.com/MyBatis-Batch-Executor-td3784939.html
Then there is this 'working on something' teaser:
http://camel.465427.n5.nabble.com/Alan-batch-database-insert-td4452866.html#a4454264
I am hoping somebody out there has a full example they may be able to share?
Thanks!
Aaron