Mybatis upgrade issues related to parameters

451 Views Asked by At

I was trying to upgrade my spring version from 4 to 5.3.23 Also updated Jackson databind to 2.13.5 While doing so I needed to upgrade mybatis from 3.0 to 3.5.11 Also mybatis-spring from 1.0 to 2.1.0

While upgrading, i found strange behaviour happening to mybatis requests.

I’m getting an error -

java.lang.IllegalStateException: Type handler was null on parameter mapping for property '__frch_token_1'. It was either not specified and/or could not be found for the javaType

(com.fasterxml.jackson.databind.node.ArrayNode): jdbcType (null) combination. ### Cause:

java.lang.IllegalStateException: Type handler was null on parameter mapping for property __frch_token_1'. It was either not specified and/or could not be found for the javaType

(com.fasterxml.jackson.databind.node.ArrayNode):

jdbcType (null) combination.

With earlier version of mybatis, it was working fine.

I’m passing multiple or single parameter from drop down from front end on iName column

It’s breaking at for each loop, it seems.


<select id="getByCriteria" resultMap="xyzResultMap">

<![CDATA[SELECT ]]>

<include refid="columns" />

<![CDATA[ FROM Table ]]> != null">

<if test="criteria <where>

<foreach collection "criteria" item="item" separator="AND">
 <!-- column name -->

<choose>

<when test=‘“Id".equals (item.fieldName)’>Eid</when> 
<when test=‘"Name".equals(item.fieldName)’> iName</when> 


<otherwise>/* unknown field name ${item.fieldName} */</otherwise>

</choose> 
<!-- operator and search value -->

<choose>

<when test=’"equals".equals(item.operator)'>= #{item.value}</when>

<when test=’"iCaptains".equals(item.operator)'> like UPPER('%${item.value}%')</wh

<when test=’"inSet".equals(item. operator)'><![CDATA[ IN (]]>

<foreach collection="item.value" item- "token" separator=", ">

<![CDATA[ #{token}]]>

</foreach><![CDATA[)]]>

/when>

<otherwise>/* unknown field name ${item.operator} */</otherwise>

</choose> </foreach>

</where>
</if>

Can somebody give me insights about this issue .

After implementing arraynodetype handler I was able to remove that error but I’m not getting correct results.

Seems like prepared statement is not generated correctly.

enter image description here

0

There are 0 best solutions below