原因分析:添加了JSON类型处理器 :@TableField(typeHandler = JacksonTypeHandler.class)
今天在使用MP的提供CRUD方法把User实体中的某个类类型的属性与对应数据库表中的JSON类型的字段进行互转:
在类上开启自动映射并在类的属性(类类型)上添加Json类型处理器,添加后Mp会自动将该指定的属性与数据库字段互转,但之前自定义的SQL没自动转换,所以就报错了。
报错内容:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService': Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed