I'm trying to insert a list to Mybatis and getting the foloowing error:
org.apache.ibatis.binding.BindingException: Parameter '__frch_e_0' not found. Available parameters are [list]
Can you please let know what I'm missing. Thanks
DAO interface:
void saveErrorMessageList(List<ErrorMessage> emList);
XML:
<insert id="saveErrorMessageList" parameterType="java.util.List">
{call
declare
ID PLS_INTEGER;
begin
<foreach collection="list" item="e" index="index" >
SELECT SEQ_ERR_ID.NEXTVAL into ID FROM DUAL;
INSERT INTO ERR (ERR_ID, CREAT_TS,
MSG_CD, MSG_TXT) values (ID,CURRENT_TIMESTAMP,
#{e.code}, #{e.message});
</foreach>
end
}
</insert>
Error Message:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_e_0' not found. Available parameters are [list]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
at com.sun.proxy.$Proxy11.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
at com.sun.proxy.$Proxy12.saveBeneErrorMessageList(Unknown Source)
at ...
... 35 more
check column name and bean field name in sql
try to update mybatis version. when i use 3.3.0 have this error, but use 3.4.1 it is ok