实体类中的字段
```java
@ApiModelProperty(position = 1040, value = "终端系列产品", example = "['s','fd']")
private ListString tsProducts;
``
转换器使用@Component注解
```java
@Component
public class ListLongTypeHandler extends JsonTypeHandler<ListLong> {
}
###### 运行结果及报错内容
使用@Component注解就会在项目启动的时候报错
```java
Caused by: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'tsProducts'. It was either not specified and/or could not be found for the javaType (com.huawei.it.basis.mybatis.type.ListString) : jdbcType (null) combination.
然后使用
mybatis-plus:
type-handlers-package: "com.huawei.it.basis.mybatis.handler" 扫描包时项目启动就不会报错
不知道是什么原因,劳烦大家解答一下困惑!
没有生成bean
不要自己去构造SqlSessionFactory,
不要自己去构造SqlSessionFactory,
不要自己去构造SqlSessionFactory,
这样你注入就能被加载到mybatis的全局配置中了