版本

mybatis-plus 3.5.3

该问题是如何引起的?(确定最新版也有问题再提!!!)

  1. 创建Temp 对象,对象中包含一个基本类型字段
  2. 在Test 对象中添加Temp 类型字段,并且增加注解 @TableField(typeHandler = JacksonTypeHandler.class)
  3. 使用lambdaUpdate 进行set 设置值
  4. 程序提示错误,使用updateById 则没有错误 ,错误信息是 Use setObject() with an explicit Types value to specify the type to use.

重现步骤(如果有就写完整)

  1. 创建 对象
class Temp{
  public String address; 
}

@TableName(value = "test",autoResultMap = true)
class Test{

   @TableId
   Long id;  

   @TableField(typeHandler = JacksonTypeHandler.class)
 public Temp temp
}

  1. 进行update测试
 var update = Wrappers.<Test>lambdaUpdate();
update.set(Test::getTemp,new Temp()).eq(Test::getId,1);

报错信息

Comment From: miemieYaho

MyBatis-Plus   [research]: 技术调研 。注解@TableField 中typeHandler 是否无法在 lambdaUpdate ,lambdaQuery中不能使用

Comment From: wxiao1002

thx