Hi,
Our team is trying to upgrade to camel 3.14.4 from camel 2.25.1

We use mybatis with camel-mybatis.

In 2.25.1 was possible to set Map as body to camel parameter binding:
Example:

Mybatis Mapper:
@Insert(value = "INSERT INTO TABLE_X (COL1, COL2, COL2) VALUES (#{col1}, 
#{col2}, #{col3})")
    void insertRecord(
            @Param("col1") String col1,
            @Param("col2") String col2,
            @Param("col3") String col3);

Camel:
                .process(exchange -> {
                    Map<String, String> params = new HashMap<>();
                    params.put("col1", "a");
                    params.put("col2", "b");
                    params.put("col3", "c");
                    exchange.getIn().setBody(params);
                })
                .to("mybatis:insertRecord?statementType=Insert&transacted=true")

After migrating to 3.14.4 following error is received:
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter 
for property named 'col1' in 'class java.util.HashMap$Node'

After having a look on the code looks like issue is caused by 
org.apache.camel.support.ObjectHelper used in 
org.apache.camel.component.mybatis.MyBatisProducer
MyBatisProducer  Line 129             Iterator<?> iter = 
ObjectHelper.createIterator(in);
ObjectHelper Line 693   } else if (value instanceof Map) {
            Map<?, ?> map = (Map<?, ?>) value;
            return map.entrySet();
        }

In version 2.25.1 the create iterator did not had this piece of code so it 
allowed support to use Map for parameter binding



---
Die Europ?ische Kommission hat unter http://ec.europa.eu/consumers/odr/ eine 
Europ?ische Online-Streitbeilegungsplattform (OS-Plattform) errichtet. 
Verbraucher k?nnen die OS-Plattform f?r die au?ergerichtliche Beilegung von 
Streitigkeiten aus Online-Vertr?gen mit in der EU niedergelassenen Unternehmen 
nutzen.

Informationen (einschlie?lich Pflichtangaben) zu einzelnen, innerhalb der EU 
t?tigen Gesellschaften und Zweigniederlassungen des Konzerns Deutsche Bank 
finden Sie unter https://www.deutsche-bank.de/Pflichtangaben. Diese E-Mail 
enth?lt vertrauliche und/ oder rechtlich gesch?tzte Informationen. Wenn Sie 
nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, 
informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das 
unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht 
gestattet.

The European Commission has established a European online dispute resolution 
platform (OS platform) under http://ec.europa.eu/consumers/odr/. Consumers may 
use the OS platform to resolve disputes arising from online contracts with 
providers established in the EU.

Please refer to https://www.db.com/disclosures for information (including 
mandatory corporate particulars) on selected Deutsche Bank branches and group 
companies registered or incorporated in the European Union. This e-mail may 
contain confidential and/or privileged information. If you are not the intended 
recipient (or have received this e-mail in error) please notify the sender 
immediately and delete this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

Reply via email to