xml配置如下:
<update id="updateUsers" parameterType="java.util.List">
<foreach collection="users" item="item" index="index" open="" close="" separator=";">
update user <set> parent_id = 0 </set> where id = ${item.id} and bjid = ${item.bjid} and njid = ${item.njid} </foreach> </update> mapper如下:
Integer updateUsers(@Param("users") List<user> users); 调用: userDao.updateUsers(userList); 异常信息如下:
org.mybatis.spring.MyBatisSystemException:nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error updating database. Cause: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long\n### The error may involve com.kjm.calm.mmapper.UserDao.updateUserInfo-Inline\n### The error occurred while setting parameters\n### SQL: \n### Cause: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
繁星coding
相关分类