找不到 Mybatis 类型处理程序

Mybatis type handler not fount

我有:

<delete id="deleteTaskScheduling" parameterType="List">
        DELETE FROM ct_task_scheduling WHERE taskid IN
        <foreach collection="list" item="taskid" open="(" close=")" index="index" separator=",">
            #{taskid}
        </foreach>
    </delete>

我的 POJO 有 taskid

@Data
@NoArgsConstructor
public class TaskDTO implements Serializable {

    private String taskid;
    ...
}

我正在将 TaskDTO 列表传递给接口:

List <TaskDTO> taskDTOs = new ArrayList <> ();
...
taskDAO.deleteTaskScheduling(taskDTOs);

但我遇到了这个异常:

java.lang.IllegalStateException: Type handler was null on parameter mapping for property '__frch_taskid_0'. It was either not specified and/or could not be found for the javaType (com.mycompany.DTO.TaskDTO) : jdbcType (null) combination.] with root cause

有人可以帮助我吗?谢谢

<foreach /> 中,在 item 中指定的变量表示列表中的每个元素,在您的例子中是 TaskDTO

<delete id="deleteTaskScheduling">
  DELETE FROM ct_task_scheduling WHERE taskid IN
  <foreach collection="list" item="x" open="(" close=")" separator=",">
    #{x.taskid}
  </foreach>
</delete>

详情请阅读文档。
https://mybatis.org/mybatis-3/dynamic-sql.html#foreach