I am Trying to update list for records but i got the following error in mybatis.
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'list' in 'class com.model.DataParameters'
and my mybatis xml query is as follow
<update id="deleteAssociatedEntityForParentEntity" parameterType="com.model.DataParameters">
update dataTable set deleted = #{deleted}, syncTS = #{syncTS} where
data_id in
<foreach item="dataIds" index="index" collection="list"
open="(" separator="," close=")">
#{dataIds}
</foreach>
and aData_type = #{dataType};
</update>
DataParameter class getter setter has been declared in this class. dataIds is my list.
please let me know if is their any wrong in my query. why list is not taking in? Any other way Guys ?
Put your list name of class in collection attribute and an opcional name in item attribute to use below
you try this code:
<update id="deleteAssociatedEntityForParentEntity" parameterType="com.model.DataParameters">
update dataTable set deleted = #{deleted}, syncTS = #{syncTS} where
data_id in
<foreach item="id" index="index" collection="dataIds"
open="(" separator="," close=")">
#{id}
</foreach>
and aData_type = #{dataType};
</update>