Create object using objectFactory from list

147 Views Asked by At

I'm using apache camel. I want to create Object of class Items (Items has a list of Item).

This is my route:

<route>
            <from uri="mybatis:getAllItems?statementType=SelectList&amp;?consumer.useIterator=false>

            <to uri="bean:objectFactory?method=createItems"/>

            <marshal>
                <jaxb contextPath="com.domain"
                      encoding="utf-8" prettyPrint="true" />
            </marshal>

            <to uri="activemq:queue:items"/>
        </route>
    </camelContext>

I get from database list of item and want to create Items from it, I have generated my class from xsd file. And my question is: "How can I create Object from list instead of one database object"?

1

There are 1 best solutions below

0
burki On

Is the additional question mark ? after SelectList&amp; in the mybatis URI a typo in the question? if it is really in your code you should remove it.

<from uri="mybatis:getAllItems?statementType=SelectList&amp;consumer.useIterator=false>

Apart from that, your URI look good and it should produce a List.