0

I am using declaring some REST routes, one of which is as below:

<put id="rest:award.linkfaq" uri="/award/faq" produces="application/json"
        consumes="application/json" type="com.foo.bar.FaqLink">

FaqLink is just a POJO with getter and setters for id, awardId and so on. I am also subsequently routing to a mybatis query as so:

<to uri="mybatis:linkFaq?statementType=SelectList&amp;inputHeader=${in.body}"
id="linkFaq.mybatis:linkFaq" />

In the SqlMapper, even though I have declared the ParamType as FaqLink (after declaration as a TypeAlias), the variables used as part of the query such as #{id}, #{awardId}still resolve to null.

What am I doing incorrectly that I am unable to get the SqlMapper to get the variables from the said POJO? I logged ${in.body} and it seems to be an instance of FaqLink

theTuxRacer
  • 13,709
  • 7
  • 42
  • 59
  • Why do you have specified `inputHeader` then? The parameters are mapped from body by default. `"inputHeader" parameter to use a header value as input to the component instead of the body.`, [See](http://camel.apache.org/mybatis.html) – Bedla Jul 09 '18 at 18:49
  • I guess you are right, let me try that out, @Bedla. TY. – theTuxRacer Jul 10 '18 at 09:04

0 Answers0