nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression [Solved]

This exception is usually a problem with dynamic SQL. Find the corresponding SQL and check the dynamic SQL syntax according to the following prompt information.

Problem description

Exception information:
needed exception is org.apache.ibatis.builder.builderexception: error evaluating expression 'ides'. Return value (806) was not Iterable.

According to the exception prompt information, find the dynamic SQL statement where ides is located.

<foreach  collection="ides"  index="index" item="ides" open="(" separator="," close=")">
     #{ides}
</foreach>
...
<foreach  collection="ides"  index="index" item="ides" open="(" separator="," close=")">
     #{ides}
</foreach>

Finally, it is found that
two <foreach></ foreach> Statement operates on the same item variable, resulting in the failure of dynamic SQL splicing of the latter.

Solution:

Change the item property in any statement to a different value.

<foreach  collection="ides"  index="index" item="idess" open="(" separator="," close=")">
     #{idess}
</foreach>
...
<foreach  collection="ides"  index="index" item="ides" open="(" separator="," close=")">
     #{ides}
</foreach>

Read More: