0
Follow
0
View

myabtis batch update error

zjkerhou 注册会员
2023-01-25 19:10

You're writing it wrong. It should be written like this, please refer to this example :

<update id="updateBatch"  parameterType="java.util.List">  
    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
        update course
        <set>
            name=${item.name}
        set>
        where id = ${item.id}
    foreach>      
update>
cyan1986 注册会员
2023-01-25 19:10

specifies that the type of the argument is an array. Hope to adopt oh