Mapper icon indicating copy to clipboard operation
Mapper copied to clipboard

自定义TypeHandler的时候, List<T>某些情况下会无法识别或者错误识别

Open wzyu11 opened this issue 6 years ago • 1 comments

spring-boot: 2.1.6.RELEASE tk-mybatis-spring-boot-start: 2.0.3

比如自定义的typeHandler分别为

PictureListTypeHandler extends BaseTypeHandler<List<Picture>> 
PhotoListTypeHandler extends BaseTypeHandler<List<Photo>>

作用于

@ColumnType(typeHandler = PictureListTypeHandler.class)
List<Picture> pictures;
@ColumnType(typeHandler = PhotoListTypeHandler.class)
List<Photo> photos;

有的时候两个typehandler都能够完整的对应上 有的时候会对应不上,而导致比如List<Photo>使用了List<Picture>

是一个偶发问题

补充一下: 在插入的时候似乎这个columnType注解过的没有问题 在select的时候有问题。而且如果对应的mapper类没有xml的,更容易复现一些

wzyu11 avatar Dec 16 '19 11:12 wzyu11

@ColumnType typehandler 指定枚举转换器报错org.apache.ibatis.type.EnumOrdinalTypeHandler

bluedarkni avatar Nov 04 '21 09:11 bluedarkni