我試圖插入一個列表的MyBatis和獲取foloowing錯誤:MyBatis的BindingException參數「__frch_e_0」未找到
org.apache.ibatis.binding.BindingException: Parameter '__frch_e_0' not found. Available parameters are [list]
能否請你讓知道我錯過了什麼。由於
DAO接口:
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>
錯誤消息:
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
你設法解決它嗎? – Arsen
對不起@Arsen ....不。我不得不單獨插入....不會影響性能,因爲數據大小很小 – Harry